1

i use the Idna.toAscii fun to convert a site name www.中国.中国(the tld is also has unicode chars).

the result was www.xn--fiqs8s.xn--fiqs8s

I used the Idna.toUnicode fun to convert the above punycode back to the unicode characters.

but i got only www.中国.xn--fiqs8s The toUnicode fun is ignoring the tld part.

Is there any way to over come this?

anusuya
  • 653
  • 1
  • 9
  • 24

1 Answers1

0

IDN::Idna.toUnicode("www.xn--fiqs8s.xn--fiqs8s") produces "www.中国.中国" for me.

I have version 0.0.2 of the ruby idn gem and version 1.19 of LibIDN, do you perhaps need to update one of these?

matsadler
  • 189
  • 4