-
-
25 Oct 2021 21:00:07 UTC
- Distribution: URI
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (38)
- Testers (106 / 0 / 0)
- Kwalitee
Bus factor: 6- 88.03% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (106.91KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 30 contributors-
Gisle Aas
-
Karen Etheridge
-
Olaf Alders
-
Chase Whitener
-
Ville Skyttä
-
Mark Stosberg
-
Michael G. Schwern
-
Julien Fiegehenn
-
Shoichi Kaji
-
Slaven Rezic
-
Adam Herzog
-
Alex Kapranoff
-
Brendan Byrd
-
brian d foy
-
David Schmidt
-
Dorian Taylor
-
gerard
-
Jan Dubois
-
John Karr
-
John Miller
-
Kaitlyn Parkhurst
-
Kenichi Ishigaki
-
Kent Fredric
-
Masahiro Honma
-
Matt Lawrence
-
Peter Rabbitson
-
Piotr Roszatycki
-
Salvatore Bonaccorso
-
Tatsuhiko Miyagawa
-
Torsten Förtsch
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
URI::_punycode 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 Syntax::Keyword::Try or Try::Tiny. 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 IDNA::Punycode which was the basis for this module.
SEE ALSO
IDNA::Punycode, 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.
Module Install Instructions
To install URI, copy and paste the appropriate command in to your terminal.
cpanm URI
perl -MCPAN -e shell install URI
For more information on module installation, please visit the detailed CPAN module installation guide.