7 ms·
> You can garble filenames just as easily in statically-typed languages. If the language assumes filenames are regular language strings, which not all do. > C
by masklinn 8y ago
> You can garble filenames just as easily in statically-typed languages.
If the language assumes filenames are regular language strings, which not all do.
> Consider, for example, Windows' infamous 16-bit units that aren't actually well-formed UTF-16.
unix filenames are literally just bags of bytes with no known or specified encoding.
- ubernostrum 8y agoUnix filenames don't pretend to be something they aren't. Windows filenames like to present a convincing façade of being UTF-16 right up until they aren't.
- masklinn 8y agoWindows filenames "like to present a convincing façade of being UTF-16" in the exact same way unix filenames "like to present a convincing façade of being UTF-8". Both are common assumptions neither is actually true, and all of that is well-documented.
- ubernostrum 8y agoI would express it more as "programmers in Unix environments like to act as if everything still uses the C locale everywhere, all the time".
- MrRadar 8y ago> unix filenames "like to present a convincing façade of being UTF-8" Except they never have? Unix paths have always been bags of bytes, both before Unicode and UTF-8 were invented and after. It's just convention that modern Unix systems use UTF-8 as the text encoding for paths.
- masklinn 8y ago> Except they never have? And neither have Windows paths ever actually pretended to be UTF-16, that's my point.