19 Jan
2011
19 Jan
'11
1:56 a.m.
File.read("test.txt").force_encoding("UTF-16LE").split("\n")
This script returns an error (Encoding::CompatibilityError) even with declaring char code at the beginning or the encoding of the file being UTF-16LE.
MacRuby completely ignores the encoding of the file (it always reads source files as UTF-8). So you would probably have to do split("\n".encode("UTF-16LE"))