diff --git a/ChangeLog b/ChangeLog index 574f739..7115d78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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] + Fri Oct 26 17:22:18 2012 NAKAMURA Usaku * file.c (append_fspath): need to set the encoding to result always. diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 8d72272..c7317f8 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-8") + 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("\202\240", str) + assert_equal(test_str.force_encoding("ascii-8bit"), str) # This test fail if codepage 20932 (euc) is not installed. begin