From: Clifford Heath Date: 2010-11-17T21:10:17+09:00 Subject: Re: Ruby 1.9.2 commandline options Ammar Ali wrote: > On Wed, Nov 17, 2010 at 12:20 AM, Clifford Heath wrote: >> ruby --help lists -E, which doesn't seem to work as advertised, >> but not -K, which does what I wanted. Can someone please check >> that the source code and the help message coincide? > > I'm not sure what you mean by work as advertised, but I would like to > note that the syntax for -E is different that of -K; it takes the full > encoding name, case-insensitive: > > ruby -Eutf-8:utf-8 > ruby -Eascii:utf-8 > > Does that do what you except? No, it still complains "invalid multibyte char (US-ASCII)" on a valid UTF-8 character, in a UTF-8 file having no Unicode BOM. Also, the help implies that you can set just the external encoding without the internal encoding, which I did, since I could care less which internal encoding Ruby uses. ruby --help says: ... -Eex[:in] specify the default external and internal character encodings The square brackets imply that the internal encoding is optional. Why is -K not listed in --help? Especially since it's the option that seems to actually work... Clifford Heath.