Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make idna/pure treat symbols as idn-ruby does. Closes #113.

  • Loading branch information...
commit eda47a5dbe63e27de05b3db81f523ae34374cd5d 1 parent 578f36c
@therabidbanana therabidbanana authored
Showing with 6 additions and 0 deletions.
  1. +1 −0  lib/addressable/idna/pure.rb
  2. +5 −0 spec/addressable/idna_spec.rb
View
1  lib/addressable/idna/pure.rb
@@ -106,6 +106,7 @@ def self.to_unicode(input)
# Unicode normalization form KC.
def self.unicode_normalize_kc(input)
+ input = input.to_s unless input.is_a?(String)
unpacked = input.unpack("U*")
unpacked =
unicode_compose(unicode_sort_canonical(unicode_decompose(unpacked)))
View
5 spec/addressable/idna_spec.rb
@@ -186,6 +186,11 @@
"xn--4ud"
).should == "\341\206\265"
end
+
+ it "should normalize 'string' correctly" do
+ Addressable::IDNA.unicode_normalize_kc(:'string').should == "string"
+ Addressable::IDNA.unicode_normalize_kc("string").should == "string"
+ end
end
describe Addressable::IDNA, "when using the pure-Ruby implementation" do
Please sign in to comment.
Something went wrong with that request. Please try again.