#### 3.20.8 mailutils 2047 ¶

The `mailutils 2047` command is a filter for decoding or encoding email message headers formatted in accordance with RFC 2047 (see http://www.faqs.org/rfcs/rfc2047.html. By default, it operates in encode mode and assumes the ‘`iso-8859-1`’ encoding. If arguments are supplied in the command line, they are treated as the text to operate upon. Otherwise the command acts as a UNIX filter, reading lines from the standard input and printing results on the standard output.

For example:

    $ mailutils 2047 'Keld Jørn Simonsen <keld@dkuug.dk>'
    =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>

The decode mode can be requested via the `--decode` (`-d`) option:

    $ mailutils 2047 --decode '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= \
     <keld@dkuug.dk>'
    Keld Jørn Simonsen <keld@dkuug.dk>

The `--charset` (`-c`) option changes the default character set. It is meaningful both in decode and in encode modes. In decode mode it instructs the utility to convert the output to the given character set. In encode mode it indicates the encoding of the input data, which will be reflected in the resulting string:

    $ mailutils 2047 --charset=utf-8 'Keld Jørn Simonsen <keld@dkuug.dk>'
    =?utf-8?Q?Keld J=C3=B8rn Simonsen <keld@dkuug.dk>?=

The `--encoding` (`-E`) option can be used in encode mode to change the output encoding. Valid arguments for this option are: ‘`quoted-printable`’ (the default) or ‘`base64`’.

The `--newline` (`-n`) option prints an additional newline character after each line of output.