Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
URI::_punycode(3)     User Contributed Perl Documentation    URI::_punycode(3)

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://a.net'); # http://.net-xc8g
	 $punycode = encode_punycode('bA1/4cher'); # bche_-kva
	 $punycode = encode_punycode('a>>a>>~a,oa>>a^1a,e 'a,ae'); # ihqwcrb4cv8a8dqg056pqjye

	 # decode a punycode string back into a	unicode	string
	 my $unicode = decode_punycode('http://.net-xc8g'); # http://a.net
	 $unicode = decode_punycode('bcher-kva'); # bA1/4cher			      _
	 $unicode = decode_punycode('ihqwcrb4cv8a8dqg056pqjye'); # a>>a>>~a,oa>>a^1a,e 'a,ae

DESCRIPTION
       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 IDNA <https://tools.ietf.org/html/rfc5890>.

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

   encode_punycode
	 my $punycode =	encode_punycode('http://a.net');  # http://.net-xc8g
	 $punycode = encode_punycode('bA1/4cher'); # bche_-kva
	 $punycode = encode_punycode('a>>a>>~a,oa>>a^1a,e 'a,ae') # 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://a.net
	 $unicode = decode_punycode('bcher-kva'); # bA1/4cher			      _
	 $unicode = decode_punycode('ihqwcrb4cv8a8dqg056pqjye'); # a>>a>>~a,oa>>a^1a,e 'a,ae

       Takes a Punycode	encoding and returns original Unicode string.

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

SEE ALSO
       IDNA::Punycode, RFC 3492	<https://tools.ietf.org/html/rfc3492>, RFC
       5891 <https://tools.ietf.org/html/rfc5891>

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

perl v5.32.0			  2019-01-09		     URI::_punycode(3)

NAME | SYNOPSIS | DESCRIPTION | FUNCTIONS | AUTHOR | SEE ALSO | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=URI::_punycode&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help