NAME

Net::IDN::Stupid - Stupid implementation of Internationalized Domain Names (IDNA)

SYNOPSIS

use Net::IDN::Stupid ':all';
my $a = stupid_to_ascii("müller");
my $u = stupid_to_unicode('XN--11B5BS3A9AJ6G');

DESCRIPTION

This module converts labels from domain names between ASCII and Unicode, but without any preparation (mapping and validation). 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.

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.

FUNCTIONS

By default, this module does not export any subroutines. You may use the :all tag to import everything.

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.

The following functions are available:

stupid_to_ascii( $label )

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.

stupid_to_unicode( $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).

AUTHOR

Claus Färber <CFAERBER@cpan.org>

LICENSE

Copyright 2011-2012 Claus Färber.

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

SEE ALSO

Net::IDN::Punycode, Net::IDN::Encode