5 ms·
Filenames are not buckets of bytes. They're human-readable strings. Treating them as buckets of bytes is a great way to end up in very confusing situations, lik
by eridius 9y ago
Filenames are not buckets of bytes. They're human-readable strings. Treating them as buckets of bytes is a great way to end up in very confusing situations, like having two files named "über.png" with no way to visually distinguish them.
- zlynx 9y agoI like that they ARE buckets of bytes on Unixen. As an analogy take the common text file. Would you like it if the read() and write() system calls looked at the file extension and refused to write non-ASCII or non-Unicode into it? I would not like that. The flexibility to do whatever I want with those bytes is more important than guaranteeing correct text encoding. If someone wants that for their system, make the user software do it, not the kernel.
- michaelmrose 9y agoEasily avoided, just don't do that. I've never encountered such.
- coldtea 9y ago>Treating them as buckets of bytes is a great way to end up in very confusing situations, like having two files named "über.png" with no way to visually distinguish them. That's only because of a similar cluster-fuck that is unicode compound characters and normalization schemes. One and only one unambiguous code per different visible glyph would have been too much to ask...
- michaelmrose 9y agoThis situation is a non issue in real life. Computers have no issue distinguishing them and people don't create them.
- coldtea 9y agoYou'd be surprised. For one, they allow certain kinds of attacks.