Project

General

Profile

Bug #6650 » 0001-Use-UTF-16-String-instead-of-UTF-8.patch

h.shirosaki (Hiroshi Shirosaki), 06/29/2012 09:39 PM

View differences:

test/win32ole/test_win32ole.rb
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
......
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
(2-2/2)