I'm working on an IMAP email script and I have some lines coded in GB2312 (which I assume is Chinese encoding), looks like this =?GB2312?B?foobarbazetc
How can I start working with this string? I checked mb_list_encodings()
and this one is not listed.
If you have the base64-decoded data, then use mbstring or iconv. If you have the raw header, then mbstring.
Ignacio solved the meat of the problem with
mb_decode_mimeheader()
but for future reference these links are also helpful:The specific header string I was working with:
This required a page header of
and PHP
to output