From: "luislavena (Luis Lavena)" <luislavena@...>
Date: 2012-06-30T08:38:17+09:00
Subject: [ruby-core:45977] [ruby-trunk - Bug #6650] Fixing win32ole test errors


Issue #6650 has been updated by luislavena (Luis Lavena).


h.shirosaki (Hiroshi Shirosaki) wrote:
> I had same failure on Win7 with chcp 932(default), 1252 and 65001. I guess it depends on Windows system default encoding.
> If I change the string from UTF-8 to UTF-16LE, the test works fine for me.
> UTF-16LE or ASCII String might be better. I attached the patch.

Hiroshi, I don't fully follow the rationale in the patch.

You're encoding the string first as UTF-16LE and then force encoding as UTF-16 when sending it to FSO.

AFAIK FSO Only understands ANSI and UTF-16LE.

Also, by doing force_encoding, you're changing test_str to the new encoding and not preserving the original.

I couldn't find WIN32OLE in the list of maintainers, but will be great to hear his comments.
----------------------------------------
Bug #6650: Fixing win32ole test errors
https://bugs.ruby-lang.org/issues/6650#change-27579

Author: bosko (Bo��ko Ivani��evi��)
Status: Feedback
Priority: Normal
Assignee: luislavena (Luis Lavena)
Category: test
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-06-25 trunk 36180) [i386-mingw32]


Since FileSystemObject is limited only to ANSI and UTF-16LE encoding tests shouldn't try to use other encodings since they will certainly fail. Instead UTF-16 encoding should be used to check whether writing/reading to/from FSO is properly handled. Attached is a patch that fixes this.


-- 
http://bugs.ruby-lang.org/