Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

read input file and echo accent mark

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
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

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

You need to set utf-8 to show the accent texts
Avatar of rgb192

ASKER

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

output text: Diana Cristóbal
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of rgb192

ASKER

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.