nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] base64 ... just looking for advice

2016-01-22 09:57:53
Dear David,

In message 
<a99d3e98-9457-4df9-b778-75de4f46dba1(_at_)HUBCAS2(_dot_)seas(_dot_)wustl(_dot_)edu>
 you wrote:
Hymie wrote:

So I'm just wondering what other people are doing.  Are you going into
your raw email, stripping out HTML, undecoding base64, removing extra
"multipart" parts, things like that?

See mhfixmsg(1) in nmh 1.6 or the current git repo.  Its main motivation was 
to allow grepping of messages.

Thanks for this great hint!

Hm... I still have problems understanding how to use mhfixmsg, though.

Assume I have an incoming multipart message with parts like these:

Part 1:
        Content-Type: text/plain; charset="iso-8859-1"
        Content-Transfer-Encoding: quoted-printable
Part 2:
        Content-Type: text/html; charset="iso-8859-1"
        Content-Transfer-Encoding: quoted-printable

The "file" command identifies the whole message as "ASCII text", which
makes sense, as it has only 7 bit characters.


Conversion attempt 1:

        $ mhfixmsg +inbox 174 -decodetext 8bit -verbose -outfile ...
        mhfixmsg: 174 part 2, decode text/plain; charset="iso-8859-1"
        mhfixmsg: 174 part 1, decode text/html; charset="iso-8859-1"

The resulting file is identified by "file" as "ISO-8859 text, with
very long lines"; it basically looks OK, except that I actually would
prefer to have it converted to UTF8 instead.

Conversion attempt 2:

        $ mhfixmsg +inbox 174 -decodetext 8bit -textcharset utf8 -verbose 
-outfile ...

The resulting file is identified by "file" as "Non-ISO extended-ASCII
text, with very long lines".  Opening the file in "vim" shows that all
the 8 bit characters like the German umlaut characters are wrong;
the quoted-printable encoded "f=FCr" for example was not converted
into "für" as expected, but instead into "für".

What is needed to properly decode everything into UTF8?


Thanks in advance.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd(_at_)denx(_dot_)de
"It is easier to port a shell than a shell script."      - Larry Wall

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>