2009/9/1 Urabe Shyouhei <shyouhei / ruby-lang.org>:
> Michal Suchanek wrote:
>> 2009/9/1 Yui NARUSE <redmine / ruby-lang.org>:
>>> Issue #2026 has been updated by Yui NARUSE.
>>>
>>>
>>> Current Ruby thinks the filesystem encoding of Unix is binary.
>>> Because our initial research shows users of Unix expect it.
>>>
>>> As you know, Windows is UTF-16LE/Locale (see also win32-unicode-test),
>>> and Mac OS X is UTF-8.
>>> If some OSs or distributions imply their filesystem encoding,
>>> we can follow it.
>>
>> Any distribution that sets locale (other than C) does.
>
> That's just a default and users can override it. Even if a distro sets default
> locate to UTF-8, a user can still generate a filename which is invalid asTF-8 sequence. Ruby must be able to handle that kind of filename. Hence the
> choice of binary encoding.

That's the same situation as with stdio. It is binary and can use any
encoding (or none at all)  but unless specified otherwise it is
expected to be in the current locale.

The problem is described with mkdir. In this case it is somewhat
disturbing if Ruby creates directories with names not encoded in your
locale's encoding unless you explicitly ask.

>
> On the other hand AFAIK you cannot create a UTF16-invalid filename on Windows.
>
You cannot create invalid filename on OS X either.

Thanks

Michal