Function mung::decode_rfc2047 [] [src]

pub fn decode_rfc2047<'a>(s: &'a str) -> Cow<'a, str>

Decodes RFC 2047 encoded words into their UTF-8 form

See: Message Header Extensions for Non-ASCII Text See also: base64 specification

For those unfamiliar, a base64 encoded Latin alphabet no. 1 string:


decodes to If you can read this you understand the example.

Known caveat of this function is that it returns as UTF-8; if you are decoding into another character set, be aware you will need a further conversion.


Can be called with &' str

use mung::decode_rfc2047;
let subject = decode_rfc2047( "Subject: =?GB2312?B?s8m5prXEsvrGt76twO0=?=" );