From: duerst@... Date: 2017-05-01T09:51:47+00:00 Subject: [ruby-core:80957] [Ruby trunk Feature#13488] Set Encoding.default_external to UTF-8 on Windows Issue #13488 has been updated by duerst (Martin D��rst). larskanis (Lars Kanis) wrote: > Currently Encoding.default_external is set to the local ANSI encoding of the Windows installation unless changed per option `-E`. This is cp850 for Western Europe. It should be changed to UTF-8. > > The current setting is a major interoperability issue and it is neither useful nor expected, because nobody seriously uses the ancient locale dependent cpXYZ encodings for file content. I wouldn't say that it is a setting that it totally without problems (but see below). > If a native encoding shall be used, it should be UTF-16 on Windows. However UTF-16 would make interoperability and compatibility even more difficult. So the only reliable choice for default_external is UTF-8, IMHO. I would strongly suggest to backpedal on [1]. As a longtime supporter of UTF-8, I have on various occasions tried to use UTF-8 on a Japanese Windows. I just tried again (on Windows 8.1, your mileage may vary). Unfortunately, it only works partially, not good enough to be worth it. I detected two problems that essentially make it unusable: 1) When using chcp 65001, the IME stops working. This means that it's no longer possible to type anything except ASCII on the keyboard. 2) Output from commands gets garbled. As an example, `more` produces garbage (probably Shift_JIS interpreted as UTF-8). The user may be able to live with garbage, but the problem is that the garbage also messes up the command itself; after a few times of typing the Enter key, I get a small window saying "More Utility has stopped working". > This is already patched per [1] in the upcoming RubyInstaller-2.4 for Windows release. It additionally requires a few changes to MRIs encoding tests. Please don't make this change, or make it only for those versions and code pages of Windows where you are sure that the negative consequences (see above) won't outweight the advantages. > [1] https://github.com/oneclick/rubyinstaller2/blob/master/recipes/compile/ruby-2.4.1/0005-utf-8-default-encoding.patch As for what I'm using on Windows, it's mostly cygwin. But many of my students have used the Ruby Installer in the past, successfully. It would be a pity if it were no longer possible to use the Ruby Installer on Japanese Windows. ---------------------------------------- Feature #13488: Set Encoding.default_external to UTF-8 on Windows https://bugs.ruby-lang.org/issues/13488#change-64623 * Author: larskanis (Lars Kanis) * Status: Rejected * Priority: Normal * Assignee: * Target version: ---------------------------------------- Currently Encoding.default_external is set to the local ANSI encoding of the Windows installation unless changed per option `-E`. This is cp850 for Western Europe. It should be changed to UTF-8. The current setting is a major interoperability issue and it is neither useful nor expected, because nobody seriously uses the ancient locale dependent cpXYZ encodings for file content. If a native encoding shall be used, it should be UTF-16 on Windows. However UTF-16 would make interoperability and compatibility even more difficult. So the only reliable choice for default_external is UTF-8, IMHO. This is already patched per [1] in the upcoming RubyInstaller-2.4 for Windows release. It additionally requires a few changes to MRIs encoding tests. [1] https://github.com/oneclick/rubyinstaller2/blob/master/recipes/compile/ruby-2.4.1/0005-utf-8-default-encoding.patch -- https://bugs.ruby-lang.org/ Unsubscribe: