开发者

the ruby idna.toUnicode fun, is not converting the punycode in the tld part

开发者 https://www.devze.com 2023-01-23 03:24 出处:网络
i use the Idna.toAscii fun to convert a site name w开发者_如何转开发ww.中国.中国(the tld is also has unicode chars).

i use the Idna.toAscii fun to convert a site name w开发者_如何转开发ww.中国.中国(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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消