Re:Fixing Unix Filenames (2012)
by judk on Thursday October 31, 2013 @03:02AM
(#6645591)
What happens if I try to create a filename using a character set in which octect 0x2f appears as part of a multibyte character? Oops?
[ Parent
| on HN ]
You can't do that. That's one of the upshots of the way Linux handles filenames.
Linus has talked about this in the past... because of the fact that Linux only cares about 1 "special" character (the ASCII slash), the only sensible way to do unicode for filesystem names is to use UTF-8, which is backwards compatible with ASCII and thus obeys the kernel's expectations.
It's one of those "you can have any color car so long as it's black" ultimatums... you can use whatever encoding you want, so long as it uses 0x2f for slashes, and slashes only.
Re:Fixing Unix Filenames (2012)
by lifthrasiir on Thursday October 31, 2013 @04:31AM
(#6645749)
I think neither ISO 2022 nor UTF-16/32 have never seen use in filesystem, exactly for this reason. The closest analogue of this problem in non-POSIX system is Shift_JIS, which can contain a backslash in a multibyte character (which I regard as a stupidity, given the possibility of using FD/FE bytes instead).
> can contain a backslash in a multibyte character
This is potentially confusing but, ultimately, fine. The problem is slash (byte 0x2f, in ASCII '/') in multibyte characters.
Re:Fixing Unix Filenames (2012)
by lifthrasiir on Saturday November 02, 2013 @03:42AM
(#6658483)
In Windows backslashes are analogous to slashes in the path.