Yukihiro Matsumoto
12/15/2008 4:05:00 PM
Hi,
In message "Re: ruby 1.9.1: Encoding trouble: broken US-ASCII String"
on Tue, 16 Dec 2008 00:47:37 +0900, Ollivier Robert <roberto@REMOVETHIS.eu.org> writes:
|From what I've seen and experimented with 1.9 for a few months, my main gripe
|is that the whole encoding support is overly complex. I know m17n is not
|solved by the magic unicode wand but I'd love to have a more simple way.
The whole picture must be complex, since encoding support itself is
VERY complex indeed. History sucks. But for daily use, just remember
specifying encoding if you are not sure what is the default_encoding,
e.g.
f = open(path, "r:iso-8859-1")
or
f = open(path, "r", encoding: "iso-8859-1")
Simple? If you want to convert your data into Unicode every time you
read, just put -U at your shebang (#!) line, in addition.
matz.