I have found a reference to punycode here: http://en.wikipedia.org/wiki/Punycode. I have found that what the user means by getting it right is that when he clicks on the second link he gets to the same
location as the first.
I have found several perl modules that implement punycode. The first one I picked is Encode::Punycode. Using this I was able to write the following code:

use Encode;
use Encode::Punycode;
use utf8;
print encode('Punycode', 'http://www.中時健康.tw/'), "\n";


and I got the output:

http://www..tw/-vz3x59ynj1eh73a

I can check that this URL does not work in firefox. Nor when I try to do the reverse do I get a satisfactory result:

use Encode;
use Encode::Punycode;
print decode('Punycode', 'http://www.xn--fiqx7ci2wwkh.tw/'), "\n";

returns the error message

invalid digit in input for decode_punycode at /usr/local/share/perl/5.10.0/Encode/Punycode.pm line 25

I think before this could be sent upstream it would help to have a clearer description of how it is supposed to work, a suitable tool to to do the translation and a reason why it needs to be implemented in the distribution and not on top of it.









<<attachment: nicholas.vcf>>

Reply via email to