{
    "content": [
        {
            "type": "text",
            "text": "# Unicode::Map (perldoc)\n\n## NAME\n\nUnicode::Map V0.112 - maps charsets from and to utf16 unicode\n\n## SYNOPSIS\n\nuse Unicode::Map();\n*$Map* = new Unicode::Map(\"ISO-8859-1\");\n*$utf16* = *$Map* -> tounicode (\"Hello world!\"); => $utf16 == \"\\0H\\0e\\0l\\0l\\0o\\0\n\\0w\\0o\\0r\\0l\\0d\\0!\"\n*$locale* = *$Map* -> fromunicode (*$utf16*); => $locale == \"Hello world!\"\nA more detailed description below.\n2do: short note about perl's Unicode perspectives.\n\n## DESCRIPTION\n\nThis module converts strings from and to 2-byte Unicode UCS2 format. All mappings happen via 2\nbyte UTF16 encodings, not via 1 byte UTF8 encoding. To transform these use Unicode::String.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONVERSION METHODS**\n- **WARNINGS**\n- **MAINTAINANCE METHODS**\n- **DEPRECATED METHODS**\n- **BINARY MAPPINGS**\n- **TO BE DONE**\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Unicode::Map",
        "section": "",
        "mode": "perldoc",
        "summary": "Unicode::Map V0.112 - maps charsets from and to utf16 unicode",
        "synopsis": "use Unicode::Map();\n*$Map* = new Unicode::Map(\"ISO-8859-1\");\n*$utf16* = *$Map* -> tounicode (\"Hello world!\"); => $utf16 == \"\\0H\\0e\\0l\\0l\\0o\\0\n\\0w\\0o\\0r\\0l\\0d\\0!\"\n*$locale* = *$Map* -> fromunicode (*$utf16*); => $locale == \"Hello world!\"\nA more detailed description below.\n2do: short note about perl's Unicode perspectives.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "recode",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/recode/1/json"
            },
            {
                "name": "map",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/map/1/json"
            },
            {
                "name": "mkmapfile",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/mkmapfile/1/json"
            },
            {
                "name": "Map",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/Map/3/json"
            },
            {
                "name": "Map8",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/Map8/3/json"
            },
            {
                "name": "String",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/String/3/json"
            },
            {
                "name": "CharName",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/CharName/3/json"
            },
            {
                "name": "mirrorMappings",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/mirrorMappings/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "CONVERSION METHODS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "WARNINGS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "MAINTAINANCE METHODS",
                "lines": 52,
                "subsections": []
            },
            {
                "name": "DEPRECATED METHODS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "BINARY MAPPINGS",
                "lines": 70,
                "subsections": []
            },
            {
                "name": "TO BE DONE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Unicode::Map V0.112 - maps charsets from and to utf16 unicode\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Unicode::Map();\n\n*$Map* = new Unicode::Map(\"ISO-8859-1\");\n\n*$utf16* = *$Map* -> tounicode (\"Hello world!\"); => $utf16 == \"\\0H\\0e\\0l\\0l\\0o\\0\n\\0w\\0o\\0r\\0l\\0d\\0!\"\n\n*$locale* = *$Map* -> fromunicode (*$utf16*); => $locale == \"Hello world!\"\n\nA more detailed description below.\n\n2do: short note about perl's Unicode perspectives.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module converts strings from and to 2-byte Unicode UCS2 format. All mappings happen via 2\nbyte UTF16 encodings, not via 1 byte UTF8 encoding. To transform these use Unicode::String.\n\nFor historical reasons this module coexists with Unicode::Map8. Please use Unicode::Map8 unless\nyou need to care for two byte character sets, e.g. chinese GB2312. Anyway, if you stick to the\nbasic functionality (see documentation) you can use both modules equivalently.\n\nPractically this module will disappear from earth sooner or later as Unicode mapping support\nneeds somehow to get into perl's core. If you like to work on this field please don't hesitate\ncontacting Gisle Aas!\n\nThis module can't deal directly with utf8. Use Unicode::String to convert utf8 to utf16 and vice\nversa.\n\nCharacter mapping is according to the data of binary mapfiles in Unicode::Map hierarchy. Binary\nmapfiles can also be created with this module, enabling you to install own specific character\nsets. Refer to mkmapfile or file REGISTRY in the Unicode::Map hierarchy.\n",
                "subsections": []
            },
            "CONVERSION METHODS": {
                "content": "Probably these are the only methods you will need from this module. Their usage is compatible\nwith Unicode::Map8.\n\nnew *$Map* = new Unicode::Map(\"GB2312-80\")\n\nReturns a new Map object for GB2312-80 encoding.\n\nfromunicode\n*$dest* = *$Map* -> fromunicode (*$src*)\n\nCreates a string in locale charset representation from utf16 encoded string *$src*.\n\ntounicode\n*$dest* = *$Map* -> tounicode (*$src*)\n\nCreates a string in utf16 representation from *$src*.\n\nto8 Alias for *fromunicode*. For compatibility with Unicode::Map8\n\nto16\nAlias for *tounicode*. For compatibility with Unicode::Map8\n",
                "subsections": []
            },
            "WARNINGS": {
                "content": "You can demand Unicode::Map to issue warnings at deprecated or incompatible usage with the\nconstants WARNDEFAULT, WARNDEPRECATION or WARNCOMPATIBILITY. The latter both can be ored\ntogether.\n\nNo special warnings:\n$Unicode::Map::WARNINGS = Unicode::Map::WARNDEFAULT\n\nWarnings for deprecated usage:\n$Unicode::Map::WARNINGS = Unicode::Map::WARNDEPRECATION\n\nWarnings for incompatible usage:\n$Unicode::Map::WARNINGS = Unicode::Map::WARNCOMPATIBILITY\n",
                "subsections": []
            },
            "MAINTAINANCE METHODS": {
                "content": "*Note:* These methods are solely for the maintainance of Unicode::Map. Using any of these\nmethods will lead to programs incompatible with Unicode::Map8.\n\nalias\n*@list* = *$Map* -> alias (*$csid*)\n\nReturns a list of alias names of character set *$csid*.\n\nmapping\n*$path* = *$Map* -> mapping (*$csid*)\n\nReturns the absolute path of binary character mapping for character set *$csid* according to\nREGISTRY file of Unicode::Map.\n\nid  *$realid*||\"\" = *$Map* -> id (*$testid*)\n\nReturns a valid character set identifier *$realid*, if *$testid* is a valid character set\nname or alias name according to REGISTRY file of Unicode::Map.\n\nids *@ids* = *$Map* -> ids()\n\nReturns a list of all character set names defined in REGISTRY file.\n\nreadtextmapping\n1||0 = *$Map* -> readtextmapping (*$csid*, *$path*, *$style*)\n\nRead a text mapping of style *$style* named *$csid* from filename *$path*. The mapping then\ncan be saved to a file with method: writebinarymapping. <$style> can be:\n\nstyle          description\n\n\"unicode\"    A text mapping as of ftp://ftp.unicode.org/MAPPINGS/\n\"\"           Same as \"unicode\"\n\"reverse\"    Similar to unicode, but both columns are switched\n\"keld\"       A text mapping as of ftp://dkuug.dk/i18n/charmaps/\n\nsrc *$path* = *$Map* -> src (*$csid*)\n\nReturns the path of textual character mapping for character set *$csid* according to\nREGISTRY file of Unicode::Map.\n\nstyle\n*$path* = *$Map* -> style (*$csid*)\n\nReturns the style of textual character mapping for character set *$csid* according to\nREGISTRY file of Unicode::Map.\n\nwritebinarymapping\n1||0 = *$Map* -> writebinarymapping (*$csid*, *$path*)\n\nStores a mapping that has been loaded via method readtextmapping in file *$path*.\n",
                "subsections": []
            },
            "DEPRECATED METHODS": {
                "content": "Some functionality is no longer promoted.\n\nnoise\nDeprecated! Don't use any longer.\n\nreverseunicode\nDeprecated! Use Unicode::String::byteswap instead.\n",
                "subsections": []
            },
            "BINARY MAPPINGS": {
                "content": "Structure of binary Mapfiles\n\nUnicode character mapping tables have sequences of sequential key and sequential value codes.\nThis property is used to crunch the maps easily. n (0<n<256) sequential characters are\nrepresented as a bytecount n and the first character code keystart. For these subsequences the\naccording value sequences are crunched together, also. The value 0 is used to start an extended\ninformation block (that is just partially implemented, though).\n\nOne could think of two ways to make a binary mapfile. First method would be first to write a\nlist of all key codes, and then to write a list of all value codes. Second method, used here,\nappends to all partial key code lists the according crunched value code lists. This makes value\ncodes a little bit closer to key codes.\n\nNote: the file format is still in a very liquid state. Neither rely on that it will stay as\nthis, nor that the description is bugless, nor that all features are implemented.\n\nSTRUCTURE:\n\n<main>:\noffset  structure     value\n\n0x00    word          0x27b8   (magic)\n0x02    @(<extended> || <submapping>)\n\nThe mapfile ends with extended mode <end> in main stream.\n\n<submapping>:\n0x00    byte != 0     charsize1 (bits)\n0x01    byte          n1 number of chars for one entry\n0x02    byte          charsize2 (bits)\n0x03    byte          n2 number of chars for one entry\n0x04    @(<extended> || <keyseq> || <keyvalseq)\n\nbs1=int((charsize1+7)/8), bs2=int((charsize2+7)/8)\n\nOne submapping ends when <mapend> entry occurs.\n\n<keyvalseq>:\n0x00    size=0|1|2|4  n, number of sequential characters\nsize    bs1           key1\n+bs1    bs2           value1\n+bs2    bs1           key2\n+bs1    bs2           value2\n...\n\nkeyvalseq ends, if either file ends (n = infinite mode) or n pairs are read.\n\n<keyseq>:\n0x00    byte          n, number of sequential characters\n0x01    bs1           keystart, first character of sequence\n1+bs1   @(<extended> || <valseq>)\n\nA key sequence starts with a byte count telling how long the sequence is. It is followed by\nthe key start code. After this comes a list of value sequences. The list of value sequences\nends, if sum(m) equals n.\n\n<valseq>:\n0x00    byte          m, number of sequential characters\n0x01    bs2           valstart, first character of sequence\n\n<extended>:\n0x00    byte          0\n0x01    byte          ftype\n0x02    byte          fsize, size of following structure\n0x03    fsize bytes   something\n\nFor future extensions or private use one can insert here 1..255 byte long streams. ftype can\nhave values 30..255, values 0..29 are reserved. Modi are not fully defined now and could\nchange. They will be explained later.\n",
                "subsections": []
            },
            "TO BE DONE": {
                "content": "-   Something clever, when a character has no translation.\n\n-   Direct charset -> charset mapping.\n\n-   Better performance.\n\n-   Support for mappings according to RFC 1345.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "-   File \"REGISTRY\" and binary mappings in directory \"Unicode/Map\" of your perl library path\n\n-   recode(1), map(1), mkmapfile(1), Unicode::Map(3), Unicode::Map8(3), Unicode::String(3),\nUnicode::CharName(3), mirrorMappings(1)\n\n-   RFC 1345\n\n-   Mappings at Unicode consortium ftp://ftp.unicode.org/MAPPINGS/\n\n-   Registrated Internet character sets ftp://dkuug.dk/i18n/charmaps/\n\n-   2do: more references\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Martin Schwartz <martin@nacho.de>\n",
                "subsections": []
            }
        }
    }
}