?
Solved

read input file and echo accent mark

Posted on 2013-01-23
6
Medium Priority
?
477 Views
Last Modified: 2013-01-24
I think because of the accent mark on the letter 'o'
Diana Cristóbal
is represented in an .eml file as
=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?=

when I view .eml file using notepad++

but in thunderbird, outlook it is
Diana Cristóbal

how can I use php to echo
Diana Cristóbal
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38813188
just check this,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>

<body>
Diana Crist&oacute;bal
</body>
</html>

Open in new window

0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38813191
You need to set utf-8 to show the accent texts
0
 

Author Comment

by:rgb192
ID: 38813204
please give example of utf-8 starting with
input text: =?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?=

output text: Diana Cristóbal
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 38813985
Can you try this:
<?php

error_reporting(E_ALL);

?>
<html>
<head>
<title> EE Q_28006762 </title>
</head>
<body>
<?

// manual: http://php.net/manual/en/function.mb-decode-mimeheader.php

echo mb_decode_mimeheader('=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?=');

?>
</body>
</html>

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38814100
What you're looking at here is commonly known as a character-encoding collision.  The situation arises because someone used an ASCII file, but tried to declare it to be UTF-8, or vice-versa.  Here is an explanation.
http://www.joelonsoftware.com/articles/Unicode.html

The goal to avoid these collisions is to make sure you've got consistent encodings, including your text editor, your HTML form input fields, your data base and your script outputs.
0
 

Author Closing Comment

by:rgb192
ID: 38816556
this code worked for me thanks

I did not understand Ray's advice yet
but will probably have a follow up question about what Ray wrote in the future.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question