Solved

read input file and echo accent mark

Posted on 2013-01-23
6
465 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 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 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now