4 ms·
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?
by judk 13y ago
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?
- lifthrasiir 13y agoI 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).
- derleth 13y ago> 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.
- lifthrasiir 13y agoIn Windows backslashes are analogous to slashes in the path.
- ninkendo 13y agoYou 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.