Page 1 of 1

Decoding a utf-8 encoded mail subject

Posted: Tue Mar 14, 2006 5:37 am
by nero120
Hi guys, this is my first post, but this site has helped me many times already!

I'm writing my own PHP webmail client but Im having a problem with multipart message subjects. I can get most of the subject fine, but sometimes there are weird characters that don't get decoded properly, and i don't know how to decode them into plain text. For example:

Code: Select all

=?UTF-8?Q?Halifax_Promotion_=E2=80=93_Be_prepar?= =?UTF-8?Q?ed_for_the_end_of_the_tax_year?=
I can decode to:

Code: Select all

Halifax Promotion – Be prepared for the end of the tax year
by using imap_mime_header_decode, but whats with that dirty –? I can't find a way to decode that character properly (i think it's supposed to be a hyphen from looking at my osx mail client).

If anyone can help me with this that would be wonderful!

Posted: Tue Mar 14, 2006 8:28 am
by Weirdan
It's "en dash" (hyphen)
U-00002013 E2 80 93 EN DASH