Wrong punycode of IDN domains with cyrillic letters and hyphen [fixed]

5 posts / 0 new
Last post
#1 Thu, 03/17/2011 - 06:55
Murz

Wrong punycode of IDN domains with cyrillic letters and hyphen [fixed]

Much of IDN domains added to system successfully, but at now I got one doman that added wrong (Virtualmin version 3.82.gpl): Domain is юни-пром.рф

Correctly it must be converted to: xn----otbnbhfh1i.xn--p1ai

But virtualmin is convert it to: xn---otbnbhfh1i.xn--p1ai

And in list it show me domain name like: ߷ࠋ߰߹ߺ߷߻.рф instead of юни-пром.рф

Where is the source of the problem and how I can fix it?

Thu, 03/17/2011 - 13:30
JamieCameron

This does look like a bug .. maybe. From reading the IDN spec, it seems that all domain names that have been encoded to punycode should start with xn-- , so I am confused as to why this one starts with xn---- (four dashes) ?

''

Fri, 03/18/2011 - 01:00
Murz

This is because prefix is "xn--" and string converted to punycode is started with 2 dashes: --ba4b2kwackg3mbccbci I try several punycode encoders and they add four dashes too: http://www.dnsqueries.com/en/punycode_encoder_decoder.php http://www.motobit.com/util/punycode-decoder-encoder.asp http://punycoder.com/

So, looks like this is a bug in punycode converter in Virtualmin or Webmin...

Fri, 03/18/2011 - 01:35 (Reply to #3)
JamieCameron

Ok, that makes sense now. I found a bug in the Virtualmin code where it tries to fix incorrectly converted punycode domains that start with xn--- (three dashes), but this was breaking domains starting with xn---- !

This will be fixed in the 3.85 release.

''

Thu, 06/02/2011 - 01:20 (Reply to #4)
Murz

Confirm fixing in the 3.85 release.

Topic locked