From 263cd01a31d65e0c58acf8df7a3f6a07c054b51c Mon Sep 17 00:00:00 2001 From: suke Date: Wed, 4 Jul 2012 10:17:03 +0000 Subject: [PATCH] * test/win32ole/test_win32ole.rb (test_s_codepage_changed): FileSystemObject only supports ANSI or UTF-16LE encoding. Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/win32ole/test_win32ole.rb | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dba9bcc4e..5e2c85a857 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jul 4 19:13:15 2012 Masaki Suketa + + * test/win32ole/test_win32ole.rb (test_s_codepage_changed): + FileSystemObject only supports ANSI or UTF-16LE encoding. + Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650] + + Wed Jul 4 11:52:12 2012 NAKAMURA Usaku * gc.c (ATOMIC_SIZE_*): 64bit Windows support. diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 4abfe31700..5fbfbdef16 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -351,8 +351,9 @@ if defined?(WIN32OLE) WIN32OLE.codepage = cp file = fso.opentextfile(fname, 2, true) + test_str = [0x3042].pack("U*").encode("UTF-16LE") begin - file.write [0x3042].pack("U*").force_encoding("UTF-16") + file.write test_str.force_encoding("UTF-16") ensure file.close end @@ -360,7 +361,7 @@ if defined?(WIN32OLE) open(fname, "r:ascii-8bit") {|ifs| str = ifs.read } - assert_equal("\343\201\202", str) + assert_equal(test_str.force_encoding("ascii-8bit"), str) # This test fail if codepage 20932 (euc) is not installed. begin