Skip Menu |

This queue is for tickets about the Net-IDN-Encode CPAN distribution.

Report information
The Basics
Id: 89750
Status: resolved
Priority: 0/
Queue: Net-IDN-Encode

People
Owner: CFAERBER [...] cpan.org
Requestors: felix.ostmann [...] thewar.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.004
Fixed in: 2.005



Subject: Can't create IDN for a special domain
I can't use to_unicode for this label: xn--u19a perl -MNet::IDN::Encode -e 'print Net::IDN::Encode::to_unicode("xn--u19a"),"\n";' xn--u19a But this is a valid domain under .com (and perhaps others). What is going wrong here?
I cannot reproduce this problem here (see below). What version of perl are you using? ----- echidna:~ cfaerber$ perl -v This is perl 5, version 12, subversion 4 (v5.12.4) built for darwin-thread-multi-2level Copyright 1987-2010, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. echidna:~ cfaerber$ perl -MNet::IDN::Encode -e 'print Net::IDN::Encode::to_unicode("xn--u19a"),"\n";' Wide character in print at -e line 1. ꯀ echidna:~ cfaerber$
BTW, the character was invalid (or rather: impossible to implement correctly) in IDNA 2003, thus: echidna:~ cfaerber$ perl -MNet::IDN::IDNA2003 -e 'print Net::IDN::IDNA2003::to_unicode("xn--u19a"),"\n";' xn--u19a Old versions of Net::IDN::Encode (before version 2.000) implemented IDNA 2003 instead of UTS#46. Are you sure that you are using Net::IDN::Encode v2.004?
From: felix.ostmann [...] thewar.de
OK, it is related to the perl version: $ perl -v This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi (with 61 registered patches, see perl -V for more detail) ... $ perl -MNet::IDN::Encode\ 9999 Net::IDN::Encode version 9999 required--this is only version 2.004. BEGIN failed--compilation aborted. $ perl -MNet::IDN::Encode -e 'print Net::IDN::Encode::to_unicode("xn--u19a"),"\n";' xn--u19a ------- $ perl -v This is perl 5, version 14, subversion 1 (v5.14.1) built for x86_64-linux ... $ perl -MNet::IDN::Encode\ 9999 Net::IDN::Encode version 9999 required--this is only version 2.004. BEGIN failed--compilation aborted. $ perl -MNet::IDN::Encode -e 'print Net::IDN::Encode::to_unicode("xn--u19a"),"\n";' Wide character in print at -e line 1. ꯀ
Thank you. I'm uploading a new developer's version with additional tests to get more data from CPAN testers.
The module is behaving correctly. The documentation, however, should explain this in more detail. The issue is indeed related to the perl version or, to be exact, the Unicode version supported by the perl version. The label "xn--u19a" converts to U+ABC0, which has been added in Unicode 5.2. This version of Unicode is only supported from perl 5.12 and newer. To convert labels correctly between Unicode and ASCII, each character in the label must be present in the Unicode version supported by the underlying perl. Consequently, the module will refuse to convert labels with new Unicode characters on older perls, in this case perl 5.8 and 5.10. I'll upload a new version that explains this better in the documentation. (Unfortunately, I made a mistake when converting the label manually and got some Hangul character present in Unicode 2.0. If I hadn't, I could have given you the answer right away.)