Currently, Pike's MIME.Message parser doesn't handle non-ASCII headers
with specified encodings:

> MIME.Message("Hello, world!", (["Subject": "Hello, \U0001F310"]));
(10) Result: Message(([ ]))
> (string)_;
(11) Result: "Subject: Hello, \U0001f310\r\n"
             "Content-Length: 13\r\n"
             "\r\n"
             "Hello, world!"

Going the other way:

> MIME.Message("Subject: =?UTF-8?B?SGVsbG8sIPCfjJA=?=\r\n\r\nHello, world!");
(13) Result: Message(([ ]))
> _->headers;
(14) Result: ([ /* 1 element */
               "subject": "=?UTF-8?B?SGVsbG8sIPCfjJA=?="
             ])

I'm currently working with IMAP and RFC[2]822 messages. I could either
implement RFC 2047 parsing in my app, or enhance MIME.Message to
return Unicode strings automatically.

Would this functionality be welcomed in trunk?

ChrisA
  • MIM... Chris Angelico
    • ... Martin Karlgren
      • ... Chris Angelico
        • ... Chris Angelico
          • ... Chris Angelico
            • ... Martin Karlgren
              • ... Chris Angelico
                • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
            • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
          • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
          • ... Chris Angelico

Reply via email to