Issue #13488 has been updated by Iristyle (Ethan Brown).


I agree that changing the default to UTF-8 is not appropriate on Windows in a Ruby 2.x release.

Should a change occur in Ruby 3 to make UTF-8 the default, I believe it would still be useful to gain access to the original Windows codepage as this may be the encoding of files.

I was similarly surprised to see that the rubyinstaller2 project had made the change to make UTF-8 the default on Windows in the Ruby 2.4 installer builds, and I've filed an issue at https://github.com/oneclick/rubyinstaller2/issues/38 in hopes that it will be reverted (another user has filed a similar issue report at https://github.com/oneclick/rubyinstaller2/issues/37)

----------------------------------------
Feature #13488: Set Encoding.default_external to UTF-8 on Windows
https://bugs.ruby-lang.org/issues/13488#change-64732

* 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>