From 030111ac9c00f6437263134b33a4fa616bac864c Mon Sep 17 00:00:00 2001 From: luislavena Date: Thu, 28 Jun 2012 12:33:12 +0000 Subject: [PATCH] * test/win32ole/test_win32ole.rb (test_s_codepage_changed): FileSystemObject only supports ANSI or UTF-16LE encoding. Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/win32ole/test_win32ole.rb | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebda83d475..acf4910591 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 28 20:33:15 2012 Luis Lavena + + * test/win32ole/test_win32ole.rb (test_s_codepage_changed): + FileSystemObject only supports ANSI or UTF-16LE encoding. + Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650] + Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki * class.c (class_instance_method_list): consider prepended Class/Module diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 8d72272b9c..4abfe31700 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -352,7 +352,7 @@ if defined?(WIN32OLE) WIN32OLE.codepage = cp file = fso.opentextfile(fname, 2, true) begin - file.write [0x3042].pack("U*").force_encoding("UTF-8") + file.write [0x3042].pack("U*").force_encoding("UTF-16") ensure file.close end @@ -360,7 +360,7 @@ if defined?(WIN32OLE) open(fname, "r:ascii-8bit") {|ifs| str = ifs.read } - assert_equal("\202\240", str) + assert_equal("\343\201\202", str) # This test fail if codepage 20932 (euc) is not installed. begin @@ -371,14 +371,14 @@ if defined?(WIN32OLE) WIN32OLE.codepage = cp file = fso.opentextfile(fname, 2, true) begin - file.write [164, 162].pack("c*").force_encoding("EUC-JP") + file.write [164, 162].pack("c*").force_encoding("UTF-16") ensure file.close end open(fname, "r:ascii-8bit") {|ifs| str = ifs.read } - assert_equal("\202\240", str) + assert_equal("\244\242", str) end ensure