From: Michal Suchanek Date: 2009-09-01T05:27:24+09:00 Subject: [ruby-core:25236] Re: [Bug #2026] String encodings are not supported by most of IO on Linux 2009/8/31 Yukihiro Matsumoto : > Hi, > > In message "Re: [ruby-core:25220] [Bug #2026] String encodings are not supported by most of IO on Linux" > �� ��on Tue, 1 Sep 2009 00:27:14 +0900, Vit Ondruch writes: > > |If string used as path has different than UTF-8, the path created on file system is incorrect. The described faulty behavior is common for most of Dir and IO actions. Attached script demonstrates the behavior on sample of Dir#mkdir method. > > Could you explain what you expect for the sample script? > > Ruby 1.9 does not convert path encoding automatically, since path may > be encoded in various encodings, for example, under my home directory, > I have files with names in EUC-JP and UTF-8. ��So auto conversion would > cause problem. ��It is responsibility of user program to make sure the > encoding of the path strings. > If you have your locale set then it is usually expected that your pathnames are in your locale's encoding just like stdio, text files, etc. While it is possible to mix filenames in various encodings on some filesystems it is usually not desirable (as is the case with text files - they are easiest to view when in your locale's encoding). Other filesystems require a single encoding and the filenames are probably converted from the current locale to the on-disk encoding in libc and filenames invalid in the current locale's encoding cannot be created/accessed. This is the case at least for hfsplus on OSX and perhaps some networked filesystems. Thanks Michal