1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/win32ole/test_win32ole.rb (test_s_codepage_changed):

FileSystemObject only supports ANSI or UTF-16LE encoding.
  Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
luislavena 2012-06-28 12:33:12 +00:00
parent f559d61607
commit 030111ac9c
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Thu Jun 28 20:33:15 2012 Luis Lavena <luislavena@gmail.com>
* test/win32ole/test_win32ole.rb (test_s_codepage_changed):
FileSystemObject only supports ANSI or UTF-16LE encoding.
Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650]
Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org> Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
* class.c (class_instance_method_list): consider prepended Class/Module * class.c (class_instance_method_list): consider prepended Class/Module

View file

@ -352,7 +352,7 @@ if defined?(WIN32OLE)
WIN32OLE.codepage = cp WIN32OLE.codepage = cp
file = fso.opentextfile(fname, 2, true) file = fso.opentextfile(fname, 2, true)
begin begin
file.write [0x3042].pack("U*").force_encoding("UTF-8") file.write [0x3042].pack("U*").force_encoding("UTF-16")
ensure ensure
file.close file.close
end end
@ -360,7 +360,7 @@ if defined?(WIN32OLE)
open(fname, "r:ascii-8bit") {|ifs| open(fname, "r:ascii-8bit") {|ifs|
str = ifs.read str = ifs.read
} }
assert_equal("\202\240", str) assert_equal("\343\201\202", str)
# This test fail if codepage 20932 (euc) is not installed. # This test fail if codepage 20932 (euc) is not installed.
begin begin
@ -371,14 +371,14 @@ if defined?(WIN32OLE)
WIN32OLE.codepage = cp WIN32OLE.codepage = cp
file = fso.opentextfile(fname, 2, true) file = fso.opentextfile(fname, 2, true)
begin begin
file.write [164, 162].pack("c*").force_encoding("EUC-JP") file.write [164, 162].pack("c*").force_encoding("UTF-16")
ensure ensure
file.close file.close
end end
open(fname, "r:ascii-8bit") {|ifs| open(fname, "r:ascii-8bit") {|ifs|
str = ifs.read str = ifs.read
} }
assert_equal("\202\240", str) assert_equal("\244\242", str)
end end
ensure ensure