IDN Internation Domain Names?

H

Hadmut Danisch

Hi,

any library for ruby to convert domain names from and to
IDN?

regards
Hadmut
 
A

Austin Ziegler

any library for ruby to convert domain names from and to
IDN?

Not that I know of, but aren't they supposed to just be UTF-8?

-austin
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 
D

Dominik Bathon

Not that I know of, but aren't they supposed to just be UTF-8?

No, they are encoded using Punycode:

http://en.wikipedia.org/wiki/Punycode

With a quick search for "ruby punycode", I found:

http://raa.ruby-lang.org/project/punycode4r/

And it seems to work:

Punycode.encode(Iconv.iconv("UCS-4LE", "ISO-8859-15", "b=FCcher")[0])
=3D> "bcher-kva"

(From the wikipedia article: "b=FCcher.ch would be represented as =20
xn--bcher-kva.ch in IDNA")

Punycode.encode seems to expect "UCS-4LE" encoded strings.

HTH,
Dominik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top