From: "steakknife (Barry Allard)" Date: 2013-04-07T11:33:52+09:00 Subject: [ruby-core:54074] [ruby-trunk - Feature #4270] Resolv does not handle UTF8 domain names. Issue #4270 has been updated by steakknife (Barry Allard). We've been using a monkey patch based on gnu libidn's functions for rfcs 3490, 3491 & 3492. Here's an extract of the critical functions (toASCII and toUNICODE), please feel free to hack/comment/dwfyl: https://gist.github.com/5328637 ---------------------------------------- Feature #4270: Resolv does not handle UTF8 domain names. https://bugs.ruby-lang.org/issues/4270#change-38323 Author: postmodern (Hal Brodigan) Status: Assigned Priority: Normal Assignee: akr (Akira Tanaka) Category: lib Target version: next minor =begin Resolv.getaddress(es) cannot handle UTF8 domain names: Steps to reproduce error: Resolv.getaddress('���.com') Expected result: 174.132.17.93 Actual result: Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:757:in `[]=' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:757:in `sender' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:504:in `block in each_resource' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:1000:in `block (3 levels) in resolv' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:998:in `each' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:998:in `block (2 levels) in resolv' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:997:in `each' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:997:in `block in resolv' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:995:in `each' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:995:in `resolv' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:498:in `each_resource' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:391:in `each_address' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:115:in `block in each_address' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:114:in `each' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:114:in `each_address' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:92:in `getaddress' from /home/hal/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/resolv.rb:43:in `getaddress' =end -- http://bugs.ruby-lang.org/