Issue #6650 has been updated by h.shirosaki (Hiroshi Shirosaki).


> 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 did force_encoding("UTF-16") because FSO doesn't allow UTF-16LE encoding and an error occurs. Bosko's patch also uses UTF-16 instead of UTF-16LE. force_encoding doesn't change binary representation of test_str.

----------------------------------------
Bug #6650: Fixing win32ole test errors
https://bugs.ruby-lang.org/issues/6650#change-27581

Author: bosko (Boko Ivanievi)
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/