Skip to content

Set default for Encoding.default_external to UTF-8 on Windows#2877

Merged
nurse merged 2 commits into
ruby:masterfrom
larskanis:utf8-default-enc
Dec 7, 2020
Merged

Set default for Encoding.default_external to UTF-8 on Windows#2877
nurse merged 2 commits into
ruby:masterfrom
larskanis:utf8-default-enc

Conversation

@larskanis

@larskanis larskanis commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

@larskanis larskanis force-pushed the utf8-default-enc branch 2 times, most recently from be25e86 to 43303a5 Compare February 4, 2020 09:21
@larskanis

Copy link
Copy Markdown
Contributor Author

@unak @nobu @nurse Could you please take a look at this request? It's open since February and no one responded.

@nobu

nobu commented Nov 13, 2020

Copy link
Copy Markdown
Member

I'm fine myself to switch the default encoding to UTF-8, but wonder if the real world use cases are UTF-8 ready on Windows.
No problems already?

@larskanis

Copy link
Copy Markdown
Contributor Author

Thanks @nobu for responding!

No problems already?

None. I switched to UTF-8 as the default_encoding starting with RubyInstaller-2.7.0-1. This is set per RUBYOPT=-Eutf-8 and since this environment variable affects all installed ruby versions I changed ruby-2.6.6, 2.5.8 and 2.4.10 versions as well. Althought I clearly communicated this change, I didn't receive a single bug report.

There have been issues with irb/readline in the past, but they are all fixed now.

I would like to drop the RUBYOPT crutch starting with RubyInstaller-3.0 by the attached change. In addition to the inconsistencies already described, it fixes inconsistencies between 7z and exe versions of RubyInstaller (7z doesn't set RUBYOPT) and between CI environments (Appveyor uses locale shell encoding while github uses UFT-8).

@larskanis

Copy link
Copy Markdown
Contributor Author

Can I do anything to get this merged?

@nurse nurse merged commit 94b6933 into ruby:master Dec 7, 2020
tvpartytonight added a commit to tvpartytonight/puppet-runtime that referenced this pull request Apr 7, 2023
When ruby changed the `Encoding.default_external` with this PR at
ruby/ruby#2877, it broke puppet testing
for Japanese Windows. With the default encoding set to UTF-8, both
facter and puppet would error. This commit to puppet-runtime will
modify the way puppet builds ruby and revert that commit, allowing
powershell to use the locale instead of defaulting to utf-8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants