From: Dominik Bathon Date: 2005-07-25T10:42:38+09:00 Subject: Re: IDN Internation Domain Names? On Mon, 25 Jul 2005 00:40:55 +0200, Austin Ziegler wrote: > On 7/22/05, Hadmut Danisch wrote: >> 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? 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�cher")[0]) => "bcher-kva" (From the wikipedia article: "b�cher.ch would be represented as xn--bcher-kva.ch in IDNA") Punycode.encode seems to expect "UCS-4LE" encoded strings. HTH, Dominik