Permalink
Browse files

Handle non-ASCII characters in WHOIS responses

  • Loading branch information...
1 parent 555f3db commit 2bd1fbb74b23b2460ffdd521f5eac9924d3b5a5e @infertux infertux committed Aug 30, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/domain-profiler/whois.rb
  2. +6 −0 spec/whois/whois_spec.rb
@@ -1,7 +1,7 @@
class Whois
def parse(data)
- @data = data.to_s.split("\n")
+ @data = data.to_s.lines
# com = verisign
# net = verisign
# org = pir
@@ -36,6 +36,12 @@
whois.registrar.should == ['Unknown']
end
+ it "is able to deal with non-ASCII string input" do
+ whois = Whois.new
+ whois.parse("\xEA")
+ whois.registrar.should == ['Unknown']
+ end
+
it "knows when the domain expires" do
@zombo.expires.should == '10-oct-2010'
end

0 comments on commit 2bd1fbb

Please sign in to comment.