[前][次][番号順一覧][スレッド一覧]

ruby-changes:29793

From: usa <ko1@a...>
Date: Tue, 9 Jul 2013 10:04:18 +0900 (JST)
Subject: [ruby-changes:29793] usa:r41845 (trunk): * ext/{dl,fiddle}/win32/lib/win32/registry.rb

usa	2013-07-09 10:04:05 +0900 (Tue, 09 Jul 2013)

  New Revision: 41845

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41845

  Log:
    * ext/{dl,fiddle}/win32/lib/win32/registry.rb
      (Win32::Registry::Error#initialize): use suitable encoding for the
      string.

  Modified files:
    trunk/ChangeLog
    trunk/ext/dl/win32/lib/win32/registry.rb
    trunk/ext/fiddle/win32/lib/win32/registry.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41844)
+++ ChangeLog	(revision 41845)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul  9 10:02:45 2013  NAKAMURA Usaku  <usa@r...>
+
+	* 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@r...>
 
 	* ext/dl/win32/lib/win32/registry.rb (Win32::Registry.expand_environ):
Index: ext/dl/win32/lib/win32/registry.rb
===================================================================
--- ext/dl/win32/lib/win32/registry.rb	(revision 41844)
+++ ext/dl/win32/lib/win32/registry.rb	(revision 41845)
@@ -174,7 +174,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/dl/win32/lib/win32/registry.rb#L174
         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
Index: ext/fiddle/win32/lib/win32/registry.rb
===================================================================
--- ext/fiddle/win32/lib/win32/registry.rb	(revision 41844)
+++ ext/fiddle/win32/lib/win32/registry.rb	(revision 41845)
@@ -174,7 +174,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/fiddle/win32/lib/win32/registry.rb#L174
         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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]