Net::IDN::Stupid - Stupid implementation of Internationalized Domain Names (IDNA)
use Net::IDN::Stupid ':all'; my $a = domain_to_ascii("müller.example.org"); my $e = email_to_ascii("POSTMASTER@例。テスト"); my $u = domain_to_unicode('EXAMPLE.XN--11B5BS3A9AJ6G');
This module provides a high-level interface for converting domain name labels, without any preparation. Use this module only if you know that your internationalized domain names are valid and in cannonical format (or if you don't care).
Usually, it is not a good idea to leave out the prepration. You might end up with a converted domain name that is not interoperable or even poses security issues due to spoofing. The name of the module reminds you of this issue.
On the plus side, this module has few dependencies, is fast, and is even compatible with perl 5.6 (whereas the other modules require perl 5.8 or 5.12).
For a more complete IDNA implementation, see Net::IDN::Encode.
By default, this module does not export any subroutines. You may use the :all tag to import everything.
:all
You can omit the 'stupid_' prefix when accessing the functions with a full-qualified module name (e.g. you can access stupid_to_unicode as Net::IDN::Stupid::stupid_to_unicode or Net::IDN::Stupid::to_unicode.
'stupid_'
stupid_to_unicode
Net::IDN::Stupid::stupid_to_unicode
Net::IDN::Stupid::to_unicode
The following functions are available:
Converts a single label $label to ASCII. Will throw an exception on invalid input. If $label is already in ASCII, this function will never fail but return $label as is as a last resort.
$label
Converts a single label $label to Unicode. Will throw an exception on invalid input. If $label is in ASCII, this function will never fail but return $label as is as a last resort.
If $label is already in ASCII, this function will never fail but return $label as is as a last resort (i.e. pass-through).
Claus Färber <CFAERBER@cpan.org>
Copyright 2007-2011 Claus Färber.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::IDN::Punycode, Net::IDN::Encode
To install Net::IDN::Punycode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::IDN::Punycode
CPAN shell
perl -MCPAN -e shell install Net::IDN::Punycode
For more information on module installation, please visit the detailed CPAN module installation guide.