Browse files

Add Iconv support for some parsers

  • Loading branch information...
1 parent 8837158 commit 955d5157c3b92679e62cca57d469713dedcbe5d1 @axic committed Feb 20, 2010
Showing with 4 additions and 2 deletions.
  1. +2 −2 lib/whois/definitions/tlds.rb
  2. +2 −0 lib/whois/server/adapters/base.rb
View
4 lib/whois/definitions/tlds.rb
@@ -145,7 +145,7 @@
Whois::Server.define :tld, ".hn", "whois.afilias-grs.info", {:adapter=>Whois::Server::Adapters::Afilias}
Whois::Server.define :tld, ".hr", nil, {:web=>"http://www.dns.hr/pretrazivanje.html", :adapter=>Whois::Server::Adapters::Web}
Whois::Server.define :tld, ".ht", "whois.nic.ht"
-Whois::Server.define :tld, ".hu", "whois.nic.hu"
+Whois::Server.define :tld, ".hu", "whois.nic.hu", {:charset=>'ISO-8859-1'}
Whois::Server.define :tld, ".id", "whois.pandi.or.id"
Whois::Server.define :tld, ".ie", "whois.domainregistry.ie"
Whois::Server.define :tld, ".il", "whois.isoc.org.il"
@@ -229,7 +229,7 @@
Whois::Server.define :tld, ".pn", nil, {:web=>"http://www.pitcairn.pn/PnRegistry/", :adapter=>Whois::Server::Adapters::Web}
Whois::Server.define :tld, ".pr", "whois.nic.pr"
Whois::Server.define :tld, ".ps", nil, {:web=>"http://www.nic.ps/whois/whois.html", :adapter=>Whois::Server::Adapters::Web}
-Whois::Server.define :tld, ".pt", "whois.dns.pt"
+Whois::Server.define :tld, ".pt", "whois.dns.pt", {:charset=>'ISO-8859-1'}
Whois::Server.define :tld, ".pw", nil, {:adapter=>Whois::Server::Adapters::None}
Whois::Server.define :tld, ".py", nil, {:web=>"http://www.nic.py/consultas.html", :adapter=>Whois::Server::Adapters::Web}
Whois::Server.define :tld, ".qa", nil, {:adapter=>Whois::Server::Adapters::None}
View
2 lib/whois/server/adapters/base.rb
@@ -14,6 +14,7 @@
#++
+require 'iconv'
require 'whois/answer/part'
require 'whois/answer'
@@ -70,6 +71,7 @@ def with_buffer(&block)
# Store an answer part in <tt>@buffer</tt>.
def append_to_buffer(response, host)
+ response = Iconv.conv('utf-8', @options[:charset], response) if @options[:charset]
@buffer << ::Whois::Answer::Part.new(response, host)
end

0 comments on commit 955d515

Please sign in to comment.