{
    "content": [
        {
            "type": "text",
            "text": "# MIME::WordDecoder (info)\n\n## NAME\n\nMIME::WordDecoder - decode RFC 2047 encoded words to a local representation  WARNING: Most of this module is deprecated and may disappear.  The only function you should use for MIME decoding is \"mimetoperlstring\".\n\n## SYNOPSIS\n\nSee MIME::Words for the basics of encoded words.  See \"DESCRIPTION\" for\nhow this class works.\nuse MIME::WordDecoder;\n### Get the default word-decoder (used by unmime()):\n$wd = default MIME::WordDecoder;\n### Get a word-decoder which maps to ISO-8859-1 (Latin1):\n$wd = supported MIME::WordDecoder \"ISO-8859-1\";\n### Decode a MIME string (e.g., into Latin1) via the default decoder:\n$str = $wd->decode('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n### Decode a string using the default decoder, non-OO style:\n$str = unmime('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n### Decode a string to an internal Perl string, non-OO style\n### The result is likely to have the UTF8 flag ON.\n$str = mimetoperlstring('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n\n## DESCRIPTION\n\nWARNING: Most of this module is deprecated and may disappear.  It\nduplicates (badly) the function of the standard 'Encode' module.  The\nonly function you should rely on is mimetoperlstring.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PUBLIC INTERFACE**\n- **SUBCLASSES**\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MIME::WordDecoder",
        "section": "",
        "mode": "info",
        "summary": "MIME::WordDecoder - decode RFC 2047 encoded words to a local representation  WARNING: Most of this module is deprecated and may disappear.  The only function you should use for MIME decoding is \"mimetoperlstring\".",
        "synopsis": "See MIME::Words for the basics of encoded words.  See \"DESCRIPTION\" for\nhow this class works.\nuse MIME::WordDecoder;\n### Get the default word-decoder (used by unmime()):\n$wd = default MIME::WordDecoder;\n### Get a word-decoder which maps to ISO-8859-1 (Latin1):\n$wd = supported MIME::WordDecoder \"ISO-8859-1\";\n### Decode a MIME string (e.g., into Latin1) via the default decoder:\n$str = $wd->decode('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n### Decode a string using the default decoder, non-OO style:\n$str = unmime('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n### Decode a string to an internal Perl string, non-OO style\n### The result is likely to have the UTF8 flag ON.\n$str = mimetoperlstring('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 48,
                "subsections": []
            },
            {
                "name": "PUBLIC INTERFACE",
                "lines": 79,
                "subsections": []
            },
            {
                "name": "SUBCLASSES",
                "lines": 48,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "MIME::WordDecoder - decode RFC 2047 encoded words to a local\nrepresentation\n\nWARNING: Most of this module is deprecated and may disappear.  The only\nfunction you should use for MIME decoding is \"mimetoperlstring\".\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "See MIME::Words for the basics of encoded words.  See \"DESCRIPTION\" for\nhow this class works.\n\nuse MIME::WordDecoder;\n\n### Get the default word-decoder (used by unmime()):\n$wd = default MIME::WordDecoder;\n\n### Get a word-decoder which maps to ISO-8859-1 (Latin1):\n$wd = supported MIME::WordDecoder \"ISO-8859-1\";\n\n### Decode a MIME string (e.g., into Latin1) via the default decoder:\n$str = $wd->decode('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n\n### Decode a string using the default decoder, non-OO style:\n$str = unmime('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n\n### Decode a string to an internal Perl string, non-OO style\n### The result is likely to have the UTF8 flag ON.\n$str = mimetoperlstring('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "WARNING: Most of this module is deprecated and may disappear.  It\nduplicates (badly) the function of the standard 'Encode' module.  The\nonly function you should rely on is mimetoperlstring.\n\nA MIME::WordDecoder consists, fundamentally, of a hash which maps a\ncharacter set name (US-ASCII, ISO-8859-1, etc.) to a subroutine which\nknows how to take bytes in that character set and turn them into the\ntarget string representation.  Ideally, this target representation\nwould be Unicode, but we don't want to overspecify the translation that\ntakes place: if you want to convert MIME strings directly to Big5,\nthat's your own decision.\n\nThe subroutine will be invoked with two arguments: DATA (the data in\nthe given character set), and CHARSET (the upcased character set name).\n\nFor example:\n\n### Keep 7-bit characters as-is, convert 8-bit characters to '#':\nsub keep7bit {\nlocal $ = shift;\ntr/\\x00-\\x7F/#/c;\n$;\n}\n\nHere's a decoder which uses that:\n\n### Construct a decoder:\n$wd = MIME::WordDecoder->new({'US-ASCII'   => \"KEEP\",   ### sub { $[0] }\n'ISO-8859-1' => \\&keep7bit,\n'ISO-8859-2' => \\&keep7bit,\n'Big5'       => \"WARN\",\n'*'          => \"DIE\"});\n\n### Convert some MIME text to a pure ASCII string...\n$ascii = $wd->decode('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n\n### ...which will now hold: \"To: Keld J#rn Simonsen <keld>\"\n\nThe UTF-8 built-in decoder decodes everything into Perl's internal\nstring format, possibly turning on the internal UTF8 flag.  Use it like\nthis:\n\n$wd = supported MIME::WordDecoder 'UTF-8';\n$perlstring = $wd->decode('To: =?ISO-8859-1?Q?KeldJ=F8rnSimonsen?= <keld>');\n# perlstring will be a valid UTF-8 string with the \"UTF8\" flag set.\n\nGenerally, you should use the UTF-8 decoder in preference to \"unmime\".\n",
                "subsections": []
            },
            "PUBLIC INTERFACE": {
                "content": "default [DECODER]\nClass method.  Get/set the default DECODER object.\n\nsupported CHARSET, [DECODER]\nClass method.  If just CHARSET is given, returns a decoder object\nwhich maps data into that character set (the character set is\nforced to all-uppercase).\n\n$wd = supported MIME::WordDecoder \"ISO-8859-1\";\n\nIf DECODER is given, installs such an object:\n\nMIME::WordDecoder->supported(\"ISO-8859-1\" =>\n(new MIME::WordDecoder::ISO8859 \"1\"));\n\nYou should not override this method.\n\nnew [\\@HANDLERS]\nClass method, constructor.  If \\@HANDLERS is given, then @HANDLERS\nis passed to handler() to initialize the internal map.\n\nhandler CHARSET=>\\&SUBREF, ...\nInstance method.  Set the handler SUBREF for a given CHARSET, for\nas many pairs as you care to supply.\n\nWhen performing the translation of a MIME-encoded string, a given\nSUBREF will be invoked when translating a block of text in\ncharacter set CHARSET.  The subroutine will be invoked with the\nfollowing arguments:\n\nDATA    - the data in the given character set.\nCHARSET - the upcased character set name, which may prove useful\nif you are using the same SUBREF for multiple CHARSETs.\nDECODER - the decoder itself, if it contains configuration information\nthat your handler function needs.\n\nFor example:\n\n$wd = new MIME::WordDecoder;\n$wd->handler('US-ASCII'   => \"KEEP\");\n$wd->handler('ISO-8859-1' => \\&handlelatin1,\n'ISO-8859-2' => \\&handlelatin1,\n'*'          => \"DIE\");\n\nNotice that, much as with %SIG, the SUBREF can also be taken from a\nset of special keywords:\n\nKEEP     Pass data through unchanged.\nIGNORE   Ignore data in this character set, without warning.\nWARN     Ignore data in this character set, with warning.\nDIE      Fatal exception with \"can't handle character set\" message.\n\nThe subroutine for the special CHARSET of 'raw' is used for raw\n(non-MIME-encoded) text, which is supposed to be US-ASCII.  The\nhandler for 'raw' defaults to whatever was specified for 'US-ASCII'\nat the time of construction.\n\nThe subroutine for the special CHARSET of '*' is used for any\nunrecognized character set.  The default action for '*' is WARN.\n\ndecode STRING\nInstance method.  Decode a STRING which might contain MIME-encoded\ncomponents into a local representation (e.g., UTF-8, etc.).\n\nunmime STRING\nFunction, exported.  Decode the given STRING using the default()\ndecoder.  See default().\n\nYou should consider using the UTF-8 decoder instead.  It decodes\nMIME strings into Perl's internal string format.\n\nmimetoperlstring\nFunction, exported.  Decode the given STRING into an internal Perl\nUnicode string.  You should use this function in preference to all\nothers.\n\nThe result of mimetoperlstring is likely to have Perl's UTF8\nflag set.\n",
                "subsections": []
            },
            "SUBCLASSES": {
                "content": "MIME::WordDecoder::ISO8859\nA simple decoder which keeps US-ASCII and the 7-bit characters of\nISO-8859 character sets and UTF8, and also keeps 8-bit characters\nfrom the indicated character set.\n\n### Construct:\n$wd = new MIME::WordDecoder::ISO8859 2;    ### ISO-8859-2\n\n### What to translate unknown characters to (can also use empty):\n### Default is \"?\".\n$wd->unknown(\"?\");\n\n### Collapse runs of unknown characters to a single unknown()?\n### Default is false.\n$wd->collapse(1);\n\nAccording to http://czyborra.com/charsets/iso8859.html (ca.\nNovember 2000):\n\nISO 8859 is a full series of 10 (and soon even more) standardized\nmultilingual single-byte coded (8bit) graphic character sets for\nwriting in alphabetic languages:\n\n1. Latin1 (West European)\n2. Latin2 (East European)\n3. Latin3 (South European)\n4. Latin4 (North European)\n5. Cyrillic\n6. Arabic\n7. Greek\n8. Hebrew\n9. Latin5 (Turkish)\n10. Latin6 (Nordic)\n\nThe ISO 8859 charsets are not even remotely as complete as the\ntruly great Unicode but they have been around and usable for quite\na while (first registered Internet charsets for use with MIME) and\nhave already offered a major improvement over the plain 7bit US-\nASCII.\n\nCharacters 0 to 127 are always identical with US-ASCII and the\npositions 128 to 159 hold some less used control characters: the\nso-called C1 set from ISO 6429.\n\nMIME::WordDecoder::USASCII\nA subclass of the ISO-8859-1 decoder which discards 8-bit\ncharacters.  You're probably better off using ISO-8859-1.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "MIME::Tools\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Eryq (eryq@zeegee.com), ZeeGee Software Inc (http://www.zeegee.com).\nDianne Skoll (dfs@roaringpenguin.com) http://www.roaringpenguin.com\n\nperl v5.26.1                      2017-10-20            MIME::WordDecoder(3pm)",
                "subsections": []
            }
        }
    }
}