Skip Menu |

This queue is for tickets about the IDNA-Punycode CPAN distribution.

Report information
The Basics
Id: 16146
Status: resolved
Priority: 0/
Queue: IDNA-Punycode

People
Owner: CFAERBER [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.03
Fixed in: 1.000



If a prefix is set, IDNA::Punycode incorrectly encodes strings that don't contain any ASCII characters (it adds an additional '-' between prefix and encoded string). For example, '他们为什么不说中文' ("\x{4ED6}\x{4EEC}\x{4E3A}\x{4EC0}\x{4E48}\x{4E0D}\x{8BF4}\x{4E2D}\x{6587}") is converted to 'xn---ihqwcrb4cv8a8dqg056pqjye' instead of 'xn--ihqwcrb4cv8a8dqg056pqjye' (this is an example from RFC 3492).
use strict; use Test::More tests => 1; use IDNA::Punycode; use utf8; is(encode_punycode("\x{4ED6}\x{4EEC}\x{4E3A}\x{4EC0}\x{4E48}\x{4E0D}\x{8BF4}\x{4E2D}\x{6587}"),'xn--ihqwcrb4cv8a8dqg056pqjye');
yup, was a bug. fixed in v 0.04.
v0.04 has not yet been uploaded to CPAN.