From: "NARUSE, Yui" Date: 2008-02-07T05:24:09+09:00 Subject: Re: Have the rules for source file encoding changed? Ni, Dave Thomas wrote: > Does the -E command line option no longer set source file encoding? -E command doesn't set default string literal encoding. string literal encoding is given by magic comment and -K. default string literal encoding was ASCII-8BIT at 1.9.0, and changed to US-ASCII. > dave[RUBY3/Book 12:44:13] cat t.rb > p __ENCODING__ > dave[RUBY3/Book 12:46:47] ruby t.rb > # > dave[RUBY3/Book 12:46:52] ruby -E utf-8 t.rb > # So this is expected behavior. > Also, can I confirm that US-ASCII is now the default, rather than > ASCII-8BIT? If so, will -Kn be changed to use US-ASCII as well (it > currently sets ASCII-8BIT) Yes, default string literal encoding is now US-ASCII. -Kn is still set ASCII-8BIT. This won't be changed for 1.8 compatibility (i think). However -Kn option is deprecated. When you want to set string literal encoding as ASCII-8BIT, you should write magic comment and set string literal encoding ISO-8859-1 or UTF-8 or something. -- NARUSE, Yui DBDB A476 FDBD 9450 02CD 0EFC BCE3 C388 472E C1EA