Encode:...ncWords(3)

πŸ’– NAME πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation page for Encode::MIME::EncWords(3) β€” yes, the manual-page energy is real ✨. This is Encode::MIME::EncWords -- MIME 'B' and 'Q' header encoding (alternative). That's the whole vibe: MIME header encoding, but the alternative flavor πŸ’….


πŸŽ€ SYNOPSIS πŸŽ€

Here's the group-chat screenshot of how you actually use it:

use Encode::MIME::EncWords;
use Encode qw/encode decode/;

# decode header:
$utf8   = decode('MIME-EncWords', $header);

# encode header with default charset, UTF-8:
$header = encode('MIME-EncWords', $utf8);

# encode header with another charset:
Encode::MIME::EncWords->config(Charset => 'GB2312');
$header = encode('MIME-EncWords', $utf8);

✨ ABSTRACT ✨

This module implements MIME header encoding described in RFC 2047. Iconic.

There are three variant encoding names and one shorthand special to a charset:

  • MIME-EncWords β€” result of encode(): auto-detect B or Q.
  • MIME-EncWords-B β€” result: =?XXXX?B?...?= β€” default is UTF-8.
  • MIME-EncWords-Q β€” result: =?XXXX?Q?...?= β€” comment: ,, (same default as above, bestie).
  • MIME-EncWords-ISO_2022_JP β€” result: =?ISO-2022-JP?B?...?=.

All encodings generate the same result by decode(). No cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

This module is intended to be an alternative of "MIME-*" encodings provided by Encode::MIME::Header core module. To find out how to use this module in detail, see Encode. πŸ’–

🌸 Module specific feature 🌸

config(KEY => VALUE, ...);

Class method. Set options by KEY => VALUE pairs. Following options are available. Obsessed with a config list, honestly.

  • Charset β€” [encode] Name of character set by which data elements will be converted. Default is "UTF-8". On "MIME-EncWords-ISO_2022_JP" it is fixed to "ISO-2022-JP".
  • Detect7bit β€” [decode/encode] Try to detect 7-bit charset on unencoded portions. Default is "YES".
  • Field β€” [encode] Name of the header field which will be considered on the first line of encoded result in its length. Default is "undef".
  • Mapping β€” [decode/encode] Specify mappings actually used for charset names. Default is "EXTENDED".
  • MaxLineLen β€” [encode] Maximum line length excluding newline. Default is 76.
  • Minimal β€” [encode] Whether to do minimal encoding or not. Default is "YES".

For more details about options see MIME::EncWords. πŸ’…


πŸ’€ CAVEAT πŸ’€

  • The encoding modules for MIME header encoding are not the magic porridge pot to cook complex header fields properly. 😭
    • To decode address header fields (From:, To:, ...), at first parse mailbox-list; then decode each element by encoding module. To encode them, at first encode each element by encoding module; then construct mailbox-list of encoded elements. To construct or parse mailbox-list, some modules such as Mail::Address may be used.
  • Lines are delimited with LF ("\n"). RFC5322 states that lines in Internet messages are delimited with CRLF ("\r\n"). 🫢

πŸ› BUGS πŸ›

Please report bugs or buggy behaviors to developer.

CPAN Request Tracker: <http://rt.cpan.org/Public/Dist/Display.html?Name=MIME-EncWords>.


⭐ VERSION ⭐

Consult $VERSION variable.

This is experimental release. Features might be changed in the near future.

Development versions of this package may be found at <http://hatuka.nezumi.nu/repos/MIME-EncWords/>.


🌈 SEE ALSO 🌈

Encode, Encode::MIME::Header, MIME::EncWords.

RFC 2047 MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text.


πŸ‘‘ AUTHOR πŸ‘‘

Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu>


Copyright (C) 2011 Hatuka*nezumi - IKEDA Soji.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


✨ sign-off: this page is from perl v5.42.0, dated 2024-02-13 β€” periodt, bestie πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from