diff --git a/ChangeLog b/ChangeLog index 324467637c..28102da90b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 31 17:48:43 2014 Tanaka Akira + + * lib/resolv.rb (Resolv::DNS::Label::Str#initialize): Set encoding + ASCII-8BIT before downcase. case insensivity of DNS labels doesn't + apply non-ASCII characters. [RFC 4343] + Wed Dec 31 16:48:44 2014 Nobuyoshi Nakada * parse.y (gettable_gen): disable warnings of possible reference diff --git a/lib/resolv.rb b/lib/resolv.rb index 3f3ed41a47..08bfde583b 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -1170,7 +1170,9 @@ class Resolv class Str # :nodoc: def initialize(string) @string = string - @downcase = string.downcase + # case insensivity of DNS labels doesn't apply non-ASCII characters. [RFC 4343] + # This assumes @string is given in ASCII compatible encoding. + @downcase = string.dup.force_encoding('ASCII-8BIT').downcase end attr_reader :string, :downcase