use strict; use utf8; binmode STDOUT, ":utf8"; use Net::IDN::Encode qw(:all); use Net::IDN::Punycode qw(:all); my @domain = ( 'müller.example.net', 'müßer.example.net', 'xn--mller-kva', 'xn--mller.example.net-22b' ); foreach (@domain) { printf "%s toAscii=<%s>\n", $_, to_ascii($_); printf "%s toUnicode=<%s>\n", $_, domain_to_unicode($_); printf "%s toPunycode=<%s>\n", $_, encode_punycode($_); printf "%s Unicode=<%s>\n", $_, to_unicode($_); }