Solved

read input file and echo accent mark

Posted on 2013-01-23
6
470 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
Independent Software Vendors: 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!

 
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 110

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

730 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