Issue #10493 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE

Backported into `ruby_2_1` at r49473.

usa-san, thank you for your advice. I'll keep my eyes on RubyCI, especiallyon vc-x64.

----------------------------------------
Bug #10493: Wrong encoding for Etc.getlogin in Windows
https://bugs.ruby-lang.org/issues/10493#change-51338

* Author: Dvis Mosns
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.1.4p265 (2014-10-27 revision 48166) [x64-mingw32]
* Backport: 2.0.0: DONE, 2.1: DONE
----------------------------------------

~~~ruby
name = Etc.getlogin # I've Windows username "Dvis"
puts name           # Dvis
puts name.inspect   # "D\xE2vis"
puts name.encoding  # ASCII-8BIT
name.force_encoding('Windows-1257')
puts name           # Dvis
~~~

As you can see \xE2 isn't "" in ASCII, but it is for Windws-1257 encoding.






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