Project

General

Profile

0001-FileSystemObject-does-not-support-UTF-8.patch

bosko (Boško Ivanišević), 06/26/2012 10:43 PM

View differences:

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

  
365 365
        # This test fail if codepage 20932 (euc) is not installed.
366 366
        begin
......
371 371
          WIN32OLE.codepage = cp
372 372
          file = fso.opentextfile(fname, 2, true)
373 373
          begin
374
            file.write [164, 162].pack("c*").force_encoding("EUC-JP")
374
            file.write [164, 162].pack("c*").force_encoding("UTF-16")
375 375
          ensure
376 376
            file.close
377 377
          end
378 378
          open(fname, "r:ascii-8bit") {|ifs|
379 379
            str = ifs.read
380 380
          }
381
          assert_equal("\202\240", str)
381
          assert_equal("\244\242", str)
382 382
        end
383 383

  
384 384
      ensure
385
-