Connecting Tech Pros Worldwide Help | Site Map

Email header decoding

  #1  
Old August 24th, 2007, 05:05 PM
pmz
Guest
 
Posts: n/a
Dear Group,

I've got a problem with decoding e-mail message subject, which has
been read within usage of Pear_Mail_Mime library.

There are some elements unwelcome in my subject string, such as:

=?ISO-8859-2?Q?My subject.

Especially when subject contains polish characters, i.e.:

=?ISO-8859-2?Q?Temat listu, bardzo wa=BFny, gdy=BF zawi=EAr=B1
p=F3l=B6ki=EA =BF=F1=B1ki, =

What is the easiest method of decoding it into the UTF-8 encoding?
Probably it is a common problem, so where can I find a solution for
it?

Thank you for help and all the best,
Przemek M. Zawada

  #2  
Old August 24th, 2007, 05:25 PM
burgermeister01@gmail.com
Guest
 
Posts: n/a

re: Email header decoding


On Aug 24, 10:56 am, pmz <przemek.zaw...@gmail.comwrote:
Quote:
Dear Group,
>
I've got a problem with decoding e-mail message subject, which has
been read within usage of Pear_Mail_Mime library.
>
There are some elements unwelcome in my subject string, such as:
>
=?ISO-8859-2?Q?My subject.
>
Especially when subject contains polish characters, i.e.:
>
=?ISO-8859-2?Q?Temat listu, bardzo wa=BFny, gdy=BF zawi=EAr=B1
p=F3l=B6ki=EA =BF=F1=B1ki, =
>
What is the easiest method of decoding it into the UTF-8 encoding?
Probably it is a common problem, so where can I find a solution for
it?
>
Thank you for help and all the best,
Przemek M. Zawada
A quick google search came up with the following function:
http://www.greywyvern.com/code/php/iso88592_2utf8

Looking at the PHP manual's utf8_encode method, the comments also
suggested looking into the following functions, but wasn't very
specific about how they could help:
http://www.php.net/manual/en/function.iconv.php
http://www.php.net/manual/en/function.recode-string.php


I hope that helps you!

  #3  
Old August 24th, 2007, 08:45 PM
Manuel Lemos
Guest
 
Posts: n/a

re: Email header decoding


Hello,

on 08/24/2007 12:56 PM pmz said the following:
Quote:
I've got a problem with decoding e-mail message subject, which has
been read within usage of Pear_Mail_Mime library.
>
There are some elements unwelcome in my subject string, such as:
>
=?ISO-8859-2?Q?My subject.
>
Especially when subject contains polish characters, i.e.:
>
=?ISO-8859-2?Q?Temat listu, bardzo wa=BFny, gdy=BF zawi=EAr=B1
p=F3l=B6ki=EA =BF=F1=B1ki, =
>
What is the easiest method of decoding it into the UTF-8 encoding?
Probably it is a common problem, so where can I find a solution for
it?
That is q-encoding. You need to decode that string and then you can
convert to UTF-8.

Take a look at this MIME parser class that can decode messages with
headers like that:

http://www.phpclasses.org/mimeparser


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unicode for HTTP Header ksuralta@gmail.com answers 8 June 2nd, 2008 11:37 AM
email header decoding fails ZeeGeek answers 2 April 11th, 2008 07:05 AM
Decoding 'funky' e-mail subjects Jonas Galvez answers 7 July 18th, 2005 12:39 PM
email package vs. mimify.mime_encode_header Ilpo Nyyssönen answers 7 July 18th, 2005 05:04 AM