3 ms·
> Things are much easier for the file system if it can just treat names as bags of bytes. And much, much harder for applications if that "bag of bytes" is an i
by silvestrov 10y ago
> Things are much easier for the file system if it can just treat names as bags of bytes.
And much, much harder for applications if that "bag of bytes" is an invalid UTF-8 sequence. You will end up with an invalid string (or an exception), and trying to open that file will then fail.
I'd really hope that Apple checks that the filenames are valid UTF-8 as they otherwise can end up with very interesting security bugs.
- asdfaoeu 10y agoYou can handle that fine provided you don't assume that. > I'd really hope that Apple checks that the filenames are valid UTF-8 as they otherwise can end up with very interesting security bugs. I think that's a bit pessimistic as Linux has run for year like that without any real issues.
- TazeTSchnitzel 10y ago> And much, much harder for applications if that "bag of bytes" is an invalid UTF-8 sequence. It makes copying-and-pasting filenames as Unicode unreliable, for one thing.
- loeg 10y agoAt least valid utf-8 isn't difficult for a filesystem to enforce.