Issue #8822 has been updated by Nobuyoshi Nakada.

Description updated

----------------------------------------
Bug #8822: Incorrect encoding for ENV in Windows
https://bugs.ruby-lang.org/issues/8822#change-47370

* Author: Dvis Mosns
* Status: Assigned
* Priority: Normal
* Assignee: cruby-windows
* Category: 
* Target version: 
* ruby -v: ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
----------------------------------------
When reading `ENV` and if it contains non-ASCII - string won't have correctencoding.
In Ruby 2.0 we can force it to UTF8 (it doesn't matter what's windows encoding nor consoles) and it will be correct, but in Ruby 1.9 there's no way tocorrectly read it.

Writing non-ASCII string to ENV is not possible at all neither of versions.

Also Ruby1.9 fails to read ENV with name witch contains non-ASCII

Here's [test.rb script](https://gist.github.com/davispuh/6351158) (basically set environment variable outside of ruby and in ruby print it out)

Output on [Ruby2.0](https://gist.github.com/davispuh/6351163) and on [Ruby1.9](https://gist.github.com/davispuh/6351207)

Seems it wasn't properly fixed in #5570




-- 
https://bugs.ruby-lang.org/