Project

General

Profile

Actions

Bug #877

closed

[win32] Ruby Standard Library (maybe smth else): Wrong Encoding in Files, Directories and Environment Variables

Added by eveel (Dmitry A. Ustalov) over 15 years ago. Updated almost 13 years ago.

Status:
Rejected
Target version:
ruby -v:
-
[ruby-core:20557]

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

ruby.png (103 KB) ruby.png screenshot eveel (Dmitry A. Ustalov), 12/15/2008 07:10 AM
multibyte-cant-help.png (42.5 KB) multibyte-cant-help.png another screenshot eveel (Dmitry A. Ustalov), 12/18/2008 10:18 PM
cucumber-method-is-also-wrong.png (5.28 KB) cucumber-method-is-also-wrong.png another wrong method eveel (Dmitry A. Ustalov), 12/20/2008 11:46 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0