Bug #6650 » 0001-Use-UTF-16-String-instead-of-UTF-8.patch
| 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
|
||
- « Previous
- 1
- 2
- Next »