Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

URI::_punycode

Name URI::_punycode
Version 5.10
Located at /usr/local/share/perl5
File /usr/local/share/perl5/URI/_punycode.pm
Is Core No
Search CPAN for this module URI::_punycode
Documentation URI::_punycode
Module Details URI::_punycode


NAME

URI::_punycode - encodes Unicode string in Punycode


SYNOPSIS

  use strict;
  use warnings;
  use utf8;
  use URI::_punycode qw(encode_punycode decode_punycode);
  # encode a unicode string
  my $punycode = encode_punycode('http://β˜ƒ.net'); # http://.net-xc8g
  $punycode = encode_punycode('bΓΌcher'); # bcher-kva
  $punycode = encode_punycode('δ»–δ»¬δΈΊδ»€δΉˆδΈθ―΄δΈ­ζ–‡'); # ihqwcrb4cv8a8dqg056pqjye
  # decode a punycode string back into a unicode string
  my $unicode = decode_punycode('http://.net-xc8g'); # http://β˜ƒ.net
  $unicode = decode_punycode('bcher-kva'); # bΓΌcher
  $unicode = decode_punycode('ihqwcrb4cv8a8dqg056pqjye'); # δ»–δ»¬δΈΊδ»€δΉˆδΈθ―΄δΈ­ζ–‡


DESCRIPTION

the URI::_punycode manpage is a module to encode / decode Unicode strings into Punycode, an efficient encoding of Unicode for use with IDNA.


FUNCTIONS

All functions throw exceptions on failure. You can catch them with the Syntax::Keyword::Try manpage or the Try::Tiny manpage. The following functions are exported by default.

encode_punycode

  my $punycode = encode_punycode('http://β˜ƒ.net');  # http://.net-xc8g
  $punycode = encode_punycode('bΓΌcher'); # bcher-kva
  $punycode = encode_punycode('δ»–δ»¬δΈΊδ»€δΉˆδΈθ―΄δΈ­ζ–‡') # ihqwcrb4cv8a8dqg056pqjye

Takes a Unicode string (UTF8-flagged variable) and returns a Punycode encoding for it.

decode_punycode

  my $unicode = decode_punycode('http://.net-xc8g'); # http://β˜ƒ.net
  $unicode = decode_punycode('bcher-kva'); # bΓΌcher
  $unicode = decode_punycode('ihqwcrb4cv8a8dqg056pqjye'); # δ»–δ»¬δΈΊδ»€δΉˆδΈθ―΄δΈ­ζ–‡

Takes a Punycode encoding and returns original Unicode string.


AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net> is the author of the IDNA::Punycode manpage which was the basis for this module.


SEE ALSO

the IDNA::Punycode manpage, RFC 3492, RFC 5891


COPYRIGHT AND LICENSE

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

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024