From: "NARUSE, Yui" Date: 2010-09-01T01:54:19+09:00 Subject: [ruby-core:31973] Re: not use system for default encoding (2010/08/31 0:04), Roger Pack wrote: > It strikes me as a bit "scary" to use system locale settings to > *arbitrarily* set Encoding.default_external > > For example, I develop on windows (def: IBM437). > This means that if I want this to work cross platform I have to > specify IBM437 for every File.read (et al) that I use in my library. > So it is a bit scary. > > Suggestion: default to UTF-8 *no matter where* then allow the user to > change it if they want something else. > Or even default to BINARY (ASCII-8BIT) unless they specify. Most > users don't want/need encoding until they run into it--they can handle > it then. > Thoughts? > Thanks! > -r Japanese version of Windows uses CP932 (a.k.a. SJIS or Windows-31J). And its command prompt uses CP932; it's not UTF-8 and can't use UTF-8. So we must follow locale information. (almost always locale reflects terminal's encoding) -- NARUSE, Yui