Project

General

Profile

Backport #7296 ยป 0001-backport-bug-6650.diff

luislavena (Luis Lavena), 11/07/2012 05:20 AM

View differences:

ChangeLog
Wed Jul 4 19:13:15 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* 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]
Fri Oct 26 17:22:18 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (append_fspath): need to set the encoding to result always.
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-8")
file.write test_str.force_encoding("UTF-16")
ensure
file.close
end
......
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
    (1-1/1)