summaryrefslogtreecommitdiff
path: root/lib/resolv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r--lib/resolv.rb4
1 files changed, 3 insertions, 1 deletions
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