{
    "content": [
        {
            "type": "text",
            "text": "# Net::IDN::Encode (perldoc)\n\n## NAME\n\nNet::IDN::Encode - Internationalizing Domain Names in Applications (IDNA)\n\n## SYNOPSIS\n\nuse Net::IDN::Encode ':all';\nmy $a = domaintoascii(\"müller.example.org\");\nmy $e = emailtoascii(\"POSTMASTER@例。テスト\");\nmy $u = domaintounicode('EXAMPLE.XN--11B5BS3A9AJ6G');\n\n## DESCRIPTION\n\nThis module provides an easy-to-use interface for encoding and decoding Internationalized Domain\nNames (IDNs).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **UNICODE VERSION**\n- **FUNCTIONS** (6 subsections)\n- **AUTHOR**\n- **LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::IDN::Encode",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::IDN::Encode - Internationalizing Domain Names in Applications (IDNA)",
        "synopsis": "use Net::IDN::Encode ':all';\nmy $a = domaintoascii(\"müller.example.org\");\nmy $e = emailtoascii(\"POSTMASTER@例。テスト\");\nmy $u = domaintounicode('EXAMPLE.XN--11B5BS3A9AJ6G');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "UNICODE VERSION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 6,
                "subsections": [
                    {
                        "name": "to_ascii",
                        "lines": 41
                    },
                    {
                        "name": "to_unicode",
                        "lines": 19
                    },
                    {
                        "name": "domain_to_ascii",
                        "lines": 19
                    },
                    {
                        "name": "domain_to_unicode",
                        "lines": 17
                    },
                    {
                        "name": "email_to_ascii",
                        "lines": 13
                    },
                    {
                        "name": "email_to_unicode",
                        "lines": 14
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::IDN::Encode - Internationalizing Domain Names in Applications (IDNA)\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::IDN::Encode ':all';\nmy $a = domaintoascii(\"müller.example.org\");\nmy $e = emailtoascii(\"POSTMASTER@例。テスト\");\nmy $u = domaintounicode('EXAMPLE.XN--11B5BS3A9AJ6G');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides an easy-to-use interface for encoding and decoding Internationalized Domain\nNames (IDNs).\n\nIDNs use characters drawn from a large repertoire (Unicode), but IDNA allows the non-ASCII\ncharacters to be represented using only the ASCII characters already allowed in so-called host\nnames today (letter-digit-hyphen, \"/[A-Z0-9-]/i\").\n\nUse this module if you just want to convert domain names (or email addresses), using whatever\nIDNA standard is the best choice at the moment.\n\nYou should be familiar with Unicode support in perl, as this module expects correctly encoded\ninput. See perlunitut, perluniintro and perlunicode for details.\n",
                "subsections": []
            },
            "UNICODE VERSION": {
                "content": "To convert labels correctly between Unicode and ASCII, each character in the label must be\npresent in the Unicode version supported by your perl. Consequently, this module will refuse to\nconvert labels with new Unicode characters on older perl versions (see below).\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "By default, this module does not export any subroutines. You may use the \":all\" tag to import\neverything. You can also use regular expressions such as \"/^to/\" or \"/^email/\" to select some\nof the functions, see Exporter for details.\n\nThe following functions are available:\n",
                "subsections": [
                    {
                        "name": "to_ascii",
                        "content": "Converts a single label $label to ASCII. Will throw an exception on invalid input. If $label\nis already a valid ASCII domain label (including most NON-LDH labels such as those used for\nSRV records and fake A-labels), this function will never fail but return $label as-is if\nconversion would fail.\n\nThis function takes the following optional parameters (%param):\n\nAllowUnassigned\n(boolean) If set to a true value, code points that are unassigned in the Unicode version\nsupported by your perl are allowed. This is an extension over UTS #46.\n\nWhile this increases the number of labels that can be converted successfully (especially\non older perls) and may thus maximizes the compatibility with domain names created under\nfuture versions of Unicode, it also introduces the risk of incorrect conversions.\nCharacters added in later versions of Unicode might have properties that affect the\nconversion; if these properties are not known on your version of perl, you might\ntherefore end up with an incorrect conversion.\n\nThe default is false.\n\nUseSTD3ASCIIRules\n(boolean) If set to a true value, checks the label for compliance with STD 3 (RFC 1123)\nsyntax for host name parts. The exact checks done depend on the IDNA standard used.\nUsually, you will want to set this to true.\n\nPlease note that UseSTD3ASCIIRules only affects the conversion between ASCII labels\n(A-labels) and Unicode labels (U-labels). Labels that are in ASCII may still be\npassed-through as-is.\n\nFor historical reasons, the default is false (unlike \"domaintoascii\").\n\nTransitionalProcessing\n(boolean) If set to true, the conversion will be compatible with IDNA2003. This only\naffects four characters: 'ß' (U+00DF), 'ς' (U+03C2), ZWJ (U+200D) and ZWNJ (U+200C).\nUsually, you will want to set this to false.\n\nThe default is false.\n\nThis function does not handle strings that consist of multiple labels (such as domain\nnames). Use \"domaintoascii\" instead.\n"
                    },
                    {
                        "name": "to_unicode",
                        "content": "Converts a single label $label to Unicode. Will throw an exception on invalid input. If\n$label is an ASCII label (including most NON-LDH labels such as those used for SRV records),\nthis function will not fail but return $label as-is if conversion would fail.\n\nThis function takes the same optional parameters as \"toascii\", with the same defaults.\n\nIf $label is already in ASCII, this function will never fail but return $label as is as a\nlast resort (i.e. pass-through).\n\nThis function takes the following optional parameters (%param):\n\nAllowUnassigned\nUseSTD3ASCIIRules\nSee \"tounicode\" above. Please note that there is no need for \"TransitionalProcessing\"\nfor \"tounicode\".\n\nThis function does not handle strings that consist of multiple labels (such as domain\nnames). Use \"domaintounicode\" instead.\n"
                    },
                    {
                        "name": "domain_to_ascii",
                        "content": "Converts all labels of the hostname $domain (with labels separated by dots) to ASCII (using\n\"toascii\"). Will throw an exception on invalid input.\n\nThis function takes the following optional parameters (%param):\n\nAllowUnassigned\nTransitionalProcessing\nSee \"tounicode\" above.\n\nUseSTD3ASCIIRules\n(boolean) If set to a true value, checks the label for compliance with STD 3 (RFC 1123)\nsyntax for host name parts.\n\nThe default is true (unlike \"toascii\").\n\nThis function will convert all dots to ASCII, i.e. to U+002E (full stop). The following\ncharacters are recognized as dots: U+002E (full stop), U+3002 (ideographic full stop),\nU+FF0E (fullwidth full stop), U+FF61 (halfwidth ideographic full stop).\n"
                    },
                    {
                        "name": "domain_to_unicode",
                        "content": "Converts all labels of the hostname $domain (with labels separated by dots) to Unicode. Will\nthrow an exception on invalid input.\n\nThis function takes the same optional parameters as \"domaintoascii\", with the same\ndefaults.\n\nThis function takes the following optional parameters (%param):\n\nAllowUnassigned\nUseSTD3ASCIIRules\nSee \"domaintounicode\" above. Please note that there is no \"TransitionalProcessing\" for\n\"domaintounicode\".\n\nThis function will preserve the original version of dots. The following characters are\nrecognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth\nfull stop), U+FF61 (halfwidth ideographic full stop).\n"
                    },
                    {
                        "name": "email_to_ascii",
                        "content": "Converts the domain part (right hand side, separated by an at sign) of an RFC 2821/2822\nemail address to ASCII, using \"domaintoascii\". May throw an exception on invalid input.\n\nIt takes the same parameters as \"domaintoascii\".\n\nThis function currently does not handle internationalization of the local-part (left hand\nside). Future versions of this module might implement an ASCII conversion for the\nlocal-part, should one be standardized.\n\nThis function will convert the at sign to ASCII, i.e. to U+0040 (commercial at), as well as\nlabel separators. The following characters are recognized as at signs: U+0040 (commercial\nat), U+FE6B (small commercial at) and U+FF20 (fullwidth commercial at).\n"
                    },
                    {
                        "name": "email_to_unicode",
                        "content": "Converts the domain part (right hand side, separated by an at sign) of an RFC 2821/2822\nemail address to Unicode, using \"domaintounicode\". May throw an exception on invalid\ninput.\n\nIt takes the same parameters as \"domaintounicode\".\n\nThis function currently does not handle internationalization of the local-part (left hand\nside). Future versions of this module might implement a conversion from ASCII for the\nlocal-part, should one be standardized.\n\nThis function will preserve the original version of at signs (and label separators). The\nfollowing characters are recognized as at signs: U+0040 (commercial at), U+FE6B (small\ncommercial at) and U+FF20 (fullwidth commercial at).\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Claus Färber <CFAERBER@cpan.org>\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyright 2007-2014 Claus Färber.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Net::IDN::Punycode, Net::IDN::UTS46, Net::IDN::IDNA2003, Net::IDN::IDNA2008, UTS #46\n(<http://www.unicode.org/reports/tr46/>), RFC 5890 (<http://tools.ietf.org/html/rfc5890>).\n",
                "subsections": []
            }
        }
    }
}