Bug #877
closed[win32] Ruby Standard Library (maybe smth else): Wrong Encoding in Files, Directories and Environment Variables
Description
=begin
I am from Russia, and my system language is set to Russian.
When I tried to create a directory via Dir.mkdir method:
irb(main):002:0> Dir.mkdir "c:/ruby/проверка"
=> 0
Word "проверка" means "test" in Russian.
Directory name appears in wrong charset (details at the
screenshot).
irb(main):003:0> File.exists? "c:/ruby/проверка"
=> true
This is a root of many problems, for example, when program
tries to create a directory in %USERPROFILE%/Application Data, see:
Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.
C:\Documents and Settings\Администратор>irb
irb(main):001:0> $KCODE = 'utf8'
=> "utf8"
irb(main):002:0> ENV['userprofile']
=> "C:\Documents and Settings\\200\244\254\250\255\250стр\240тор"
irb(main):003:0> $KCODE = ''
=> ""
irb(main):004:0> ENV['userprofile']
=> "C:\Documents and Settings\\200\244\254\250\255\250\341\342\340\240\342\256
\340"
irb(main):005:0> File.exists? ENV['userprofile']
=> false
Word "Администратор" means "Administrator" in Russian.
Microsoft Windows XP [Version 5.1.2600].
C:>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Ruby is installed from http://rubyinstaller.rubyforge.org/ .
=end
Files