summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-31 08:50:10 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-31 08:50:10 +0000
commit6cf00e15f87236d79eff6092b91bb71a77f2c590 (patch)
tree62fa46553dd3fcefd6937086efbb771d03972327
parentac47d6a8cf97175e667374ddd71ad5005a421e1d (diff)
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/resolv.rb4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3244676..28102da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Dec 31 17:48:43 2014 Tanaka Akira <akr@fsij.org>
+
+ * 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 <nobu@ruby-lang.org>
* parse.y (gettable_gen): disable warnings of possible reference
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 3f3ed41..08bfde5 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