diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-04 10:17:03 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-04 10:17:03 +0000 |
commit | 263cd01a31d65e0c58acf8df7a3f6a07c054b51c (patch) | |
tree | bf47321f1d8aa97f08846451077a16e0bebb3e49 /test/win32ole | |
parent | 067b6e82376919a10f158237fe496fccbbc8150c (diff) | |
download | ruby-263cd01a31d65e0c58acf8df7a3f6a07c054b51c.tar.gz |
* 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
Diffstat (limited to 'test/win32ole')
-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 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 |