diff --git a/test/win32ole/test_folderitem2_invokeverb.rb b/test/win32ole/test_folderitem2_invokeverb.rb index 853b05bed2..07cb9802d6 100644 --- a/test/win32ole/test_folderitem2_invokeverb.rb +++ b/test/win32ole/test_folderitem2_invokeverb.rb @@ -35,6 +35,11 @@ if defined?(WIN32OLE) # verbs = @fi2.verbs verbs.extend(Enumerable) + @cp = WIN32OLE.codepage + begin + WIN32OLE.codepage = 932 + rescue + end @shortcut = verbs.collect{|verb| verb.name }.find {|name| @@ -77,6 +82,7 @@ if defined?(WIN32OLE) if @dummy_path @fso.deleteFile(@dummy_path) end + WIN32OLE.codepage = @cp end end diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 5c31f1a07f..a79434fee2 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -271,12 +271,14 @@ if defined?(WIN32OLE) # end def test_s_codepage_set + cp = WIN32OLE.codepage WIN32OLE.codepage = WIN32OLE::CP_UTF8 assert_equal(WIN32OLE::CP_UTF8, WIN32OLE.codepage) - WIN32OLE.codepage = WIN32OLE::CP_ACP + WIN32OLE.codepage = cp end def test_s_codepage_changed + cp = WIN32OLE.codepage fso = WIN32OLE.new("Scripting.FileSystemObject") fname = fso.getTempName begin @@ -326,7 +328,7 @@ if defined?(WIN32OLE) end ensure - WIN32OLE.codepage = WIN32OLE::CP_ACP + WIN32OLE.codepage = cp if (File.exist?(fname)) File.unlink(fname) end