* 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
This commit is contained in:
suke 2012-07-04 10:17:03 +00:00
parent 067b6e8237
commit 263cd01a31
2 changed files with 10 additions and 2 deletions

View file

@ -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