473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Email header decoding

pmz
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

Aug 24 '07 #1
2 7893
On Aug 24, 10:56 am, pmz <przemek.zaw...@gmail.comwrote:
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!

Aug 24 '07 #2
Hello,

on 08/24/2007 12:56 PM pmz said the following:
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/
Aug 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas Williams | last post by:
Hello everyone, my name is Tom W. And, I am new to the list, and have been using Python for about a year now. Anyway, I got a question! I am trying to decode MIME (base64) email from a POP3...
1
by: Thomas Williams | last post by:
Thanks, I tried it and it stop at: f = file("mail.txt") with the error message. TypeError: 'str' object is not callable Tom Williams
7
by: Ilpo Nyyssönen | last post by:
How do I do the same as mimify.mime_encode_header with the email package? The problem: Python 2.3.2 (#1, Oct 11 2003, 11:13:40) on linux2 Type "help", "copyright", "credits" or "license"...
6
by: Jed Parsons | last post by:
What headers to I have to know about to build thread trees from Unix mailboxes? Is it enough to get the In-Reply-To header for each message and build a dictionary of { Message-ID: message }...
1
by: Irishmaninusa | last post by:
Hello Everyone, I have email form on a website and there is some fields that have german characters in it, like the umlat and so on, when I look at the email that is retuyrned I get the...
0
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
3
by: b. dougherty | last post by:
Greetings all- I am trying to extract subject headers from emails that have been saved as text files. The subject headers are in MIME UTF-8 format, and so they appear like this: subject:...
2
by: ZeeGeek | last post by:
It seems that the decode_header function in email.Header fails when the string is in the following form, '=?gb2312?Q?=D0=C7=C8=FC?=(revised)' That's when a non-encoded string follows the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.