IDNA::Punycode(3pm)
π¦ IDNA::Punycode π
okay bestie, gather round, because this is IDNA::Punycode(3pm), straight out of the User Contributed Perl Documentation section, and the vibes are... complicated. she's giving legacy. she's giving "still here for the girls who need her." let's get into it. β¨
πΈ NAME πΈ
IDNA::Punycode β the DEPRECATED module for IDNA and Punyode π«Ά
(no that's not a typo I made, the page literally says "Punyode", and honestly? iconic of her.)
π DESCRIPTION π
so. the tea. this module is deprecated. like, officially. she said "I'm retiring, but I'm not leaving." π
please use Net::IDN::Encode to handle full domain names, and Net::IDN::Punycode for raw Punycode encoding. those are the main characters now. π
this module is only hanging around for compatibility with earlier versions of IDNA::Punycode. so if you're here, it's probably because something old needs her, and that's valid. we don't judge. π
β¨ FUNCTIONS β¨
the following functions are imported by default. so if you also use Net::IDN::Punycode, be sure to disable import from this module, or they'll be fighting in the group chat:
use IDNA::Punycode();
π idn_prefix($prefix)
sets $IDNA::Punycode::PREFIX to $prefix. simple. clean. done. π
β οΈ do not use this function in larger applications, or in environments where multiple applications share global variables (looking at you, mod_perl). instead, set the variable locally like the responsible queen you are:
local $IDNA::Punycode::PREFIX = 'yo--';
π encode_punycode($input)
- if
$IDNA::Punycode::PREFIXis'', it encodes$inputwith Punycode. - if
$IDNA::Punycode::PREFIXis not'', it encodes$inputwith Punycode and adds the prefix β but only if$inputactually contains non-base characters (i.e. characters aboveU+007F). if$inputhas no non-base characters at all, it gets returned as-is. no notes, no changes, we love a chill return. π
okay but real talk β this function does not do any string preparation as specified by nameprep or other stringprep profiles. none. zero. if you just want to convert a domain name, use Net::IDN::Encode. please. for me. π
and heads up: this function will croak on invalid input. π
π§ decode_punycode($input)
- if
$IDNA::Punycode::PREFIXis'', it decodes$inputwith Punycode. - if
$IDNA::Punycode::PREFIXis not'', it checks whether$inputstarts with the prefix. if it does, the prefix is removed and the remainder is decoded with Punycode. if$inputdoes not start with the prefix, it's returned as-is. no drama, no decoding, just vibes. πΈ
and of course β this function does not do any string preparation as specified by nameprep or other stringprep profiles (or some sort of de-preparation). like, at all. bestie, it's not that kind of function. π«
this one will also croak on invalid input. π
π AUTHORS π
Claus Faerber <CFAERBER@cpan.org>
previous version written by Tatsuhiko Miyagawa <miyagawa@bulknews.net> and extended by Robert Urban <urban@UNIX-Beratung.de>. absolute legends, all three. π«Ά
π LICENSE π
Copyright 2007-2010 Claus Faerber.
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so like, go off. β¨
π₯ SEE ALSO π₯
EncodeNet::IDN::EncodeNet::IDN::PunycodeRFC 3492(http://www.ietf.org/rfc/rfc3492.txt)
and that's the whole page, bestie!! π¦ this was IDNA::Punycode(3pm) from perl v5.26.2, dated 2018-09-01, and she's serving deprecated-but-iconic realness. lowkey she ate. π
β¨ mwah, love u, bye!! ππβ
π¦ where this page comes from
- debian bookworm: libidna-punycode-perl 1.100+dfsg-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libidna-punycode-perl 1.100+dfsg-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libidna-punycode-perl 1.100+dfsg-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libidna-punycode-perl 1.100+dfsg-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms