From: davispuh@... Date: 2014-11-11T14:29:14+00:00 Subject: [ruby-core:66204] [ruby-trunk - Bug #10493] Wrong encoding for Etc.getlogin in Windows Issue #10493 has been updated by D��vis Mos��ns. Control Panel -> Region -> Administrative -> Change system locale [Here's article describing how to change locale for Windows 7 and 8](http://www.7tutorials.com/changing-display-language-used-non-unicode-programs) For Windows 7 ![Windows 7](http://www.7tutorials.com/files/img/non_unicode_language/non_unicode4.png) For Windows 8 ![Windows 8](http://www.7tutorials.com/files/img/non_unicode_language/non_unicode6.png) To test it now I would need to setup environment and compile Ruby, but I never have done that and currently don't really have time for it. Anyway I'll see maybe I will be able to find time for it someday. ---------------------------------------- Bug #10493: Wrong encoding for Etc.getlogin in Windows https://bugs.ruby-lang.org/issues/10493#change-49900 * Author: D��vis Mos��ns * Status: Closed * Priority: Normal * Assignee: * Category: ext * Target version: current: 2.2.0 * ruby -v: ruby 2.1.4p265 (2014-10-27 revision 48166) [x64-mingw32] * Backport: 2.0.0: REQUIRED, 2.1: REQUIRED ---------------------------------------- ~~~ruby name = Etc.getlogin # I've Windows username "D��vis" puts name # D���vis puts name.inspect # "D\xE2vis" puts name.encoding # ASCII-8BIT name.force_encoding('Windows-1257') puts name # D��vis ~~~ As you can see \xE2 isn't "��" in ASCII, but it is for Windws-1257 encoding. -- https://bugs.ruby-lang.org/