Solved

read input file and echo accent mark

Posted on 2013-01-23
6
464 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 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

8 Experts available now in Live!

Get 1:1 Help Now