summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 01:04:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 01:04:05 +0000
commitabc0b2f10b8bcbd1aa62e11b864e81c0aca3ab1d (patch)
tree462181efba81b7b35f7595e3655c0c0e87186b00
parentd9726121e5ad56521a6769cd5a855eb45ef33ed5 (diff)
* ext/{dl,fiddle}/win32/lib/win32/registry.rb
(Win32::Registry::Error#initialize): use suitable encoding for the string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/dl/win32/lib/win32/registry.rb2
-rw-r--r--ext/fiddle/win32/lib/win32/registry.rb2
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c88cb602f1a..9f30781f80f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 9 10:02:45 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb
+ (Win32::Registry::Error#initialize): use suitable encoding for the
+ string.
+
Tue Jul 9 09:46:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/dl/win32/lib/win32/registry.rb (Win32::Registry.expand_environ):
diff --git a/ext/dl/win32/lib/win32/registry.rb b/ext/dl/win32/lib/win32/registry.rb
index cca578ce013..abe9e36f9bd 100644
--- a/ext/dl/win32/lib/win32/registry.rb
+++ b/ext/dl/win32/lib/win32/registry.rb
@@ -174,7 +174,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
msg = WCHAR_SPACE * 1024
len = FormatMessageW.call(0x1200, 0, code, 0, msg, 1024, 0)
msg = msg[0, len].encode
- super msg.tr("\r", '').chomp
+ super msg.tr("\r".encode(msg.encoding), '').chomp
end
attr_reader :code
end
diff --git a/ext/fiddle/win32/lib/win32/registry.rb b/ext/fiddle/win32/lib/win32/registry.rb
index 099bfd77514..1c881ee3002 100644
--- a/ext/fiddle/win32/lib/win32/registry.rb
+++ b/ext/fiddle/win32/lib/win32/registry.rb
@@ -174,7 +174,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
msg = WCHAR_SPACE * 1024
len = FormatMessageW.call(0x1200, 0, code, 0, msg, 1024, 0)
msg = msg[0, len].encode
- super msg.tr("\r", '').chomp
+ super msg.tr("\r".encode(msg.encoding), '').chomp
end
attr_reader :code
end