I don't believe this is properly fixed.
I just left a comment at https://bugs.ruby-lang.org/issues/9715#note-5, and will leave the same comment here:
The expectation is that regardless of current locale / codepage, I should get UTF-8 strings when using ENV
on Windows. Here is a simple reproduction of the failure on 2.3.0
:
C:\Users\Administrator> $env:unicode = 'taskᚠᛇᚻ'
C:\Users\Administrator> dir Env:\unicode
Name Value
---- -----
unicode taskᚠᛇᚻ
C:\Users\Administrator> ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
C:\Users\Administrator> chcp
Active code page: 437
C:\Users\Administrator> irb
irb(main):001:0> RUBY_VERSION
=> "2.3.0"
irb(main):002:0> Encoding.default_internal
=> nil
irb(main):003:0> Encoding.default_external
=> #<Encoding:IBM437>
irb(main):004:0> str = ENV['unicode']
=> "task???"
irb(main):005:0> str.encoding
=> #<Encoding:IBM437>
Again, when I access ENV
on Windows, I should receive a UTF-8 string with the correct data, not a IBM437
string. The expected string in this case is:
irb(main):036:0> str2 = "task\u16A0\u16C7\u16BB"
=> "task\u16A0\u16C7\u16BB"
irb(main):037:0> str2.encoding
=> #<Encoding:UTF-8>
Note that some browsers, like Chrome on OSX, may fail to render the Rune characters correctly, but if you copy into a proper editor or use another browser you should see the characters fine.