Skip Menu |

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

Report information
The Basics
Id: 78518
Status: resolved
Priority: 0/
Queue: Net-LibIDN

People
Owner: Nobody in particular
Requestors: jpalao [...] personasytecnicas.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net-LibIDN bug?
Date: Sun, 22 Jul 2012 17:08:52 +0200
To: bug-Net-LibIDN [...] rt.cpan.org
From: Jose Palao <jpalao [...] personasytecnicas.com>
Hi there Thomas, This may or may not be a bug, but just in case I wanted to inform. Reverse translation does not seem to work for "alí.com" I have reproduced this under fedora 15 and OS X 10.5.8 Thank you, Jose Fedora ====== [root@www ~]# rpm -qi libidn Name : libidn Version : 1.19 Release : 2.fc15 Architecture: i686 Install Date: Fri 13 May 2011 09:43:56 PM CEST Group : System Environment/Libraries Size : 559445 License : LGPLv2+ and GPLv3+ and GFDL Signature : RSA/SHA256, Fri 11 Feb 2011 09:04:11 PM CET, Key ID b4ebf579069c8460 Source RPM : libidn-1.19-2.fc15.src.rpm Build Date : Wed 09 Feb 2011 09:43:07 PM CET Build Host : x86-06.phx2.fedoraproject.org Relocations : (not relocatable) Packager : Fedora Project Vendor : Fedora Project URL : http://www.gnu.org/software/libidn/ Summary : Internationalized Domain Name support library Description : GNU Libidn is an implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group, used for internationalized domain names. [root@www ~]# perl -MNet::LibIDN=idn_to_ascii,idn_prep_name -le "print idn_to_ascii(idn_prep_name('alí.com'))" xn--al-tia.com [root@www ~]# perl -MNet::LibIDN=idn_to_unicode,idn_prep_name -le "binmode STDOUT, ':utf8'; print idn_to_unicode('xn--al-tia.com')" alã.com OSX === bash-3.2# port -v installed libidn Warning: port definitions are more than two weeks old, consider using selfupdate The following ports are currently installed: libidn @1.22_0 platform='darwin 9' archs='i386' libidn @1.22_0+universal (active) platform='darwin 9' archs='i386 ppc' bash-3.2# perl -MNet::LibIDN=idn_to_ascii,idn_prep_name -le "print idn_to_ascii(idn_prep_name('alí.com'))" xn--al-tia.com bash-3.2# perl -MNet::LibIDN=idn_to_unicode,idn_prep_name -le "binmode STDOUT, ':utf8'; print idn_to_unicode('xn--al-tia.com')" alã.com
Hello Jose, Show quoted text
> [root@www ~]# perl -MNet::LibIDN=idn_to_ascii,idn_prep_name -le > "print idn_to_ascii(idn_prep_name('alí.com'))" > xn--al-tia.com > > [root@www ~]# perl -MNet::LibIDN=idn_to_unicode,idn_prep_name -le > "binmode STDOUT, ':utf8'; print idn_to_unicode('xn--al-tia.com')" > alã.com > > OSX > === > > bash-3.2# port -v installed libidn > Warning: port definitions are more than two weeks old, consider using > selfupdate > The following ports are currently installed: > libidn @1.22_0 platform='darwin 9' archs='i386' > libidn @1.22_0+universal (active) platform='darwin 9' archs='i386 > ppc' > > bash-3.2# perl -MNet::LibIDN=idn_to_ascii,idn_prep_name -le "print > idn_to_ascii(idn_prep_name('alí.com'))" > xn--al-tia.com > > bash-3.2# perl -MNet::LibIDN=idn_to_unicode,idn_prep_name -le > "binmode STDOUT, ':utf8'; print idn_to_unicode('xn--al-tia.com')" > alã.com >
My perl module is really just calling GNU LibIDN, but you need to ensure that you are working with the right characters sets, the default is ISO-8859-1 (It's an old module ;) If I am working with the command line of LibIDN directly on my machine (Ubuntu 12.04 x86_64, LibIDN 1.23), I am getting the following $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= $ idn --idna-to-ascii alí.com xn--al-oja.com $ idn --idna-to-unicode xn--al-oja.com alí.com So I need to specify that I want to process UTF-8: $ perl -MNet::LibIDN=idn_to_ascii -le "print idn_to_ascii('alí.com','utf-8')" xn--al-oja.com $ perl -MNet::LibIDN=idn_to_unicode -le "print idn_to_unicode('xn--al-oja.com', 'utf-8')" alí.com
Subject: Re: [rt.cpan.org #78518] Net-LibIDN bug?
Date: Tue, 24 Jul 2012 21:59:11 +0200
To: bug-Net-LibIDN [...] rt.cpan.org
From: Jose Palao <jpalao [...] personasytecnicas.com>
Thank you very much Thomas!. That works! El 23/07/12 12:01, Thomas Jacob via RT escribió: Show quoted text
> perl -MNet::LibIDN=idn_to_unicode -le "print > idn_to_unicode('xn--al-oja.com', 'utf-8')"
-- Jose Palao Personas y Técnicas: Multimedia S.L. http://www.personasytecnicas.com T: +34 916620123 C: +34 629661033
Great, so I am closing the ticket. I realize that these days having Latin1 as a default is a bit anachronistic, but changing that would break backwards compatibility. On Tue Jul 24 15:59:33 2012, jpalao@personasytecnicas.com wrote: Show quoted text
> Thank you very much Thomas!. That works! > > El 23/07/12 12:01, Thomas Jacob via RT escribió:
> > perl -MNet::LibIDN=idn_to_unicode -le "print > > idn_to_unicode('xn--al-oja.com', 'utf-8')"
>