{"id":7184,"date":"2022-12-20T19:35:45","date_gmt":"2022-12-20T22:35:45","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/uri_punycode-man3\/"},"modified":"2022-12-20T19:35:45","modified_gmt":"2022-12-20T22:35:45","slug":"uri_punycode-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/uri_punycode-man3\/","title":{"rendered":"URI::_punycode (man3)"},"content":{"rendered":"<h1 align=\"center\">URI::_punycode<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FUNCTIONS\">FUNCTIONS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT AND LICENSE\">COPYRIGHT AND LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">URI::_punycode \u2212 encodes Unicode string in Punycode<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use strict; <br \/> use warnings; <br \/> use utf8; <br \/> use URI::_punycode qw(encode_punycode decode_punycode); <br \/> # encode a unicode string <br \/> my $punycode = encode_punycode(&#8216;http:\/\/\u00e2.net&#8217;); # http:\/\/.net\u2212xc8g <br \/> $punycode = encode_punycode(&#8216;b\u00c3\u00bccher&#8217;); # bcher\u2212kva <br \/> $punycode = encode_punycode(&#8216;\u00e4\u00bb\u00e4\u00bb\u00ac\u00e4\u00b8\u00ba\u00e4\u00bb\u00e4\u00b9\u00e4\u00b8\u00e8\u00af\u00b4\u00e4\u00b8\u00e6&#8217;); # ihqwcrb4cv8a8dqg056pqjye <br \/> # decode a punycode string back into a unicode string <br \/> my $unicode = decode_punycode(&#8216;http:\/\/.net\u2212xc8g&#8217;); # http:\/\/\u00e2.net <br \/> $unicode = decode_punycode(&#8216;bcher\u2212kva&#8217;); # b\u00c3\u00bccher <br \/> $unicode = decode_punycode(&#8216;ihqwcrb4cv8a8dqg056pqjye&#8217;); # \u00e4\u00bb\u00e4\u00bb\u00ac\u00e4\u00b8\u00ba\u00e4\u00bb\u00e4\u00b9\u00e4\u00b8\u00e8\u00af\u00b4\u00e4\u00b8\u00e6<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">URI::_punycode is a module to encode \/ decode Unicode strings into Punycode <https:\/\/tools.ietf.org\/html\/rfc3492>, an efficient encoding of Unicode for use with <small>IDNA<\/small> <https:\/\/tools.ietf.org\/html\/rfc5890>.<\/p>\n<h2>FUNCTIONS <a name=\"FUNCTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">All functions throw exceptions on failure. You can &#8220;catch&#8221; them with Syntax::Keyword::Try or Try::Tiny. The following functions are exported by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>encode_punycode<\/b> <br \/> my $punycode = encode_punycode(&#8216;http:\/\/\u00e2.net&#8217;); # http:\/\/.net\u2212xc8g <br \/> $punycode = encode_punycode(&#8216;b\u00c3\u00bccher&#8217;); # bcher\u2212kva <br \/> $punycode = encode_punycode(&#8216;\u00e4\u00bb\u00e4\u00bb\u00ac\u00e4\u00b8\u00ba\u00e4\u00bb\u00e4\u00b9\u00e4\u00b8\u00e8\u00af\u00b4\u00e4\u00b8\u00e6&#8217;) # ihqwcrb4cv8a8dqg056pqjye<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Takes a Unicode string (UTF8\u2212flagged variable) and returns a Punycode encoding for it.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>decode_punycode<\/b> <br \/> my $unicode = decode_punycode(&#8216;http:\/\/.net\u2212xc8g&#8217;); # http:\/\/\u00e2.net <br \/> $unicode = decode_punycode(&#8216;bcher\u2212kva&#8217;); # b\u00c3\u00bccher <br \/> $unicode = decode_punycode(&#8216;ihqwcrb4cv8a8dqg056pqjye&#8217;); # \u00e4\u00bb\u00e4\u00bb\u00ac\u00e4\u00b8\u00ba\u00e4\u00bb\u00e4\u00b9\u00e4\u00b8\u00e8\u00af\u00b4\u00e4\u00b8\u00e6<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Takes a Punycode encoding and returns original Unicode string.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tatsuhiko Miyagawa <<i>miyagawa@bulknews.net<\/i>> is the author of IDNA::Punycode which was the basis for this module.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">IDNA::Punycode, <small>RFC 3492<\/small> <https:\/\/tools.ietf.org\/html\/rfc3492>, <small>RFC 5891<\/small> <https:\/\/tools.ietf.org\/html\/rfc5891><\/p>\n<h2>COPYRIGHT AND LICENSE <a name=\"COPYRIGHT AND LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This library is free software; you can redistribute it and\/or modify it under the same terms as Perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  URI::_punycode \u2212 encodes Unicode string in Punycode <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3007,3516],"class_list":["post-7184","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-man3","tag-uri_punycode"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7184"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7184\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}