Net::IDN::UTS46(3)
Net::IDN::UTS46(3) πΈβ¨ β Unicode IDNA Compatibility Processing (UTS #46)
SYNOPSIS π
use Net::IDN:: ':all';
my $a = uts46_to_ascii("mΓΌller.example.org");
my $b = Net::IDN::UTS46::to_unicode('EXAMPLE.XN--11B5BS3A9AJ6G');
$domain =~ m/\P{Net::IDN::UTS46::IsDisallowed} and die 'oops';
DESCRIPTION π
Okay so bestie, this module is literally the exact implementation of Unicode Technical Standard #46 (Unicode IDNA Compatibility Processing). UTS #46 is one variant of Internationalized Domain Names (IDN), and its whole vibe is being compatible with domain names registered under either IDNA2003 or IDNA2008. No cap.
You should totally use this module if you want an exact implementation of the UTS #46 specification. Periodt.
But listen β if you just want to convert domain names and don't care which standard is used internally, you should use Net::IDN::Encode instead. That's the move. π
FUNCTIONS β¨
By default, this module does not export any subroutines. You may use the ":all" tag to import everything. π«Ά
You can omit the 'uts46_' prefix when accessing the functions with a full-qualified module name (e.g. you can access uts46_to_unicode as Net::IDN::UTS46::uts46_to_unicode or Net::IDN::UTS46::to_unicode). Iconic.
The following functions are available:
uts46_to_ascii( $domain, %param ) π₯
Implements the "ToASCII" function from UTS #46, section 4.2. It converts a domain name to ASCII and throws an exception on invalid input.
This function takes the following optional parameters (%param):
AllowUnassignedβ (boolean) If set to a true value, unassigned code points in the label are allowed. This is an extension over UTS #46.
The function still rejects a code point that is not a Unicode scalar value, a surrogate or a value above U+10FFFF, since it cannot form a valid label.
The default is false.
UseSTD3ASCIIRulesβ (boolean) If set to a true value, checks the label for compliance with STD 3 (RFC 1123) syntax for host name parts.
The default is true.
TransitionalProcessingβ (boolean) If set to true, the conversion will be compatible with IDNA2003. This only affects four characters:'Γ'(U+00DF),'Ο'(U+03C2), ZWJ (U+200D) and ZWNJ (U+200C). Usually, you will want to set this to false.
The default is false.
uts46_to_unicode( $label, %param ) π
Implements the "ToUnicode" function from UTS #46, section 4.3. It converts a domain name to Unicode and throws an exception on invalid input.
This function takes the following optional parameters (%param):
AllowUnassignedβ see above.UseSTD3ASCIIRulesβ see above.TransitionalProcessingβ (boolean) If given, this parameter must be false. The UTS #46 specification does not define transitional processing for ToUnicode.
UNICODE CHARACTER PROPERTIES π
This module also defines the character properties listed below.
Each character has exactly one of the following properties:
\p{Net::IDN::UTS46::IsValid}β The code point is valid, and not modified (i.e. a deviation character) in UTS #46.\p{Net::IDN::UTS46::IsIgnored}β The code point is removed (i.e. mapped to an empty string) in UTS #46.\p{Net::IDN::UTS46::IsMapped}β The code point is replaced by another string in UTS #46.\p{Net::IDN::UTS46::IsDeviation}β The code point is either mapped or valid, depending on whether the processing is transitional or not.\p{Net::IDN::UTS46::IsDisallowed}β The code point is not allowed in UTS #46.\p{Net::IDN::UTS46::IsDisallowedSTD3Ignored}β The code point is not allowed in UTS #46 if"UseSTDASCIIRules"are used but would be ignored otherwise.\p{Net::IDN::UTS46::IsDisallowedSTD3Mapped}β The code point is not allowed in UTS #46 if"UseSTDASCIIRules"are used but would be mapped otherwise.
AUTHOR π
Claus FΓ€rber
Currently maintained by Robert Rothenberg <perl@rhizomnic.com> and Paul Johnson <paul@pjcj.net>.
LICENSE π
Copyright 2011-2018 Claus FΓ€rber.
Parts copyright 2026 Robert Rothenberg <perl@rhizomnic.com> and Paul Johnson <paul@pjcj.net>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO π
Net::IDN::UTS46::Mapping, Net::IDN::Encode, UTS #46 (<http://www.unicode.org/reports/tr46/>)
And that's the whole vibe, bestie! This page was brought to you by perl v5.44.0, dated 2026-10-30. Net::IDN::UTS46(3) out! πβ¨
π¦ where this page comes from
- arch rolling: perl-net-idn-encode 2.600-1 Β· GPL-1.0-or-later AND Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms