2 ms·
> This is a long-winded way of saying UTF-8 can't really be NULL-terminated because it can contain NULLs as a matter of course. UTF-8 "can contain NULLs as a m
by Dylan16807 5y ago
> This is a long-winded way of saying UTF-8 can't really be NULL-terminated because it can contain NULLs as a matter of course.
UTF-8 "can contain NULLs as a matter of course" in exactly the same way that ASCII can.
Any system that doesn't allow null bytes in ASCII can just as easily not allow them in UTF-8.
A system that does allow them can just as easily allow them in both.
There is no difference between the two here.
-
Edit: Oh, wait, maybe you misunderstand UTF-8. The 2+ byte encodings never use bytes below 0x80. They never cause a null byte to happen. The only way you get a null byte is if it's an ASCII-compatible null character, code point 00000.
- camgunz 5y agoOop, sorry it's late here and I forgot that. OK, I'll grant you UTF-8 (or I guess any NULL-terminatable encoding like Shift JIS or EUC-JP) is better for filenames.