diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-08 05:49:26 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-08 05:49:26 +0000 |
commit | bb74a0d0d18107f138c1f87c098f2de0cb82fe01 (patch) | |
tree | b3776b09c905e2fb7da51c8c90ac2d960fd05088 /test | |
parent | 73c6469a00a5fadf26c35689231656a02092f594 (diff) |
merge revision(s) 36306: [Backport #7296]
* 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/branches/ruby_1_9_3@37555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/win32ole/test_win32ole.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 8d72272b9c..c7317f83de 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 |