Project

General

Profile

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
351 351

  
352 352
        WIN32OLE.codepage = cp
353 353
        file = fso.opentextfile(fname, 2, true)
354
        test_str = [0x3042].pack("U*").encode("UTF-16LE")
354 355
        begin
355
          file.write [0x3042].pack("U*").force_encoding("UTF-16")
356
          file.write test_str.force_encoding("UTF-16")
356 357
        ensure
357 358
          file.close
358 359
        end
......
360 361
        open(fname, "r:ascii-8bit") {|ifs|
361 362
          str = ifs.read
362 363
        }
363
        assert_equal("\343\201\202", str)
364
        assert_equal(test_str.force_encoding("ascii-8bit"), str)
364 365

  
365 366
        # This test fail if codepage 20932 (euc) is not installed.
366 367
        begin
367
-