From: Josef 'Jupp' Schugt Date: 2003-04-03T09:05:55+09:00 Subject: Re: parsing/decoding mail/news headers Saluton! * Martin Pirker ; 2003-04-02, 00:27 UTC: > In RMail in found header/address parsing functions (nice stuff!), but I > still havn't figured out how to decode the header parts which have been > encoded for 7-bit(?) compatibility, ASCII that is. > > e.g. given > Subject: =?ISO-8859-1?Q?Erg=E4nzung?= > > should decode to > Subject: Erg�nzung > > (that's a german word) Synonym: Addendum If you want to convert this to ordinary Latin-1 text: If header matches '=?ISO-8859-1?Q?' (read in text up to terminating '=') then repace =AF by \0xAF. Quick and dirty but works. To a lesser degree this also works with Codepage-1252 (Windows) and Latin 9 (ISO-8859-15). CP1252 defines characters not defined in ISO charsets whereas ISO-8859-15 replaces some of the ISO-8859-1 characters. See 'Character Encoding' on my homepage. I have tables that show what Hexcodes map to which Unicode number for quite a lot of character sets. I don't have any CJK, sorry but I at least have VISCII. Gis, Josef 'Jupp' Schugt http://jupp.tux.nu jupp(AT)gmx(DOT)de -- "If this were a dictatorship, it'd be a heck of a lot easier...just as long as I'm the dictator..." -- George W. Bush on 2000-12-18 at Washington, District of Columbia