On Mon, Mar 14, 2016 at 10:30 PM, Jon LaBadie <mut...@jgcomp.com> wrote:
> I frequently find headers (mostly Subject, but also From/To)
> that I assume are some representation form for a UTF-8 encoded
> string as they start with "=?UTF-8?" and end with "=?= ".
> For example:
>
>   To: =?UTF-8?B?Z3VuZGk=?= <user@domain>
>
> Is my assumption correct?  What is the representation called?
> Is there a tool to regain the original string?
> I believe my video system can display the larger
> character set.

Quite funny, I spent some time on it yesterday...

This is rfc2047 encoding [1]. It can probably use other charsets (not
only UTF-8).

The best way I found is to pipe it through perl -MEncode -ne 'print
encode("UTF8",decode("MIME-Header",$_))'. But if Ionel's explanation
is correct, a simple regexp and base64 -d would be quicker. Don't
hesitate to give us feedback. :)

[1] https://www.ietf.org/rfc/rfc2047.txt

-- 
Gabriel

Reply via email to