The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

  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');

DESCRIPTION

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.

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 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.

SEE ALSO

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