Hacker News new | ask | show | jobs
by mr_mitm 54 days ago
So many headaches could be avoided if we only allowed `[A-Za-z0-9._-]` in paths. (Arguably, even `-` can be problematic.) Encoding issues, expansion, parameter separation, ... and I never saw a convincing case in favor of supporting anything else.
4 comments

What about people who do not speak English? or even use Latin letters?
The language I grew up with does use non latin letters, I can manage. Then again, it's only four of them, so I get your point ... but I can dream, can't I?
They managed just fine when ASCII was all they had.
What Latin letter(s) are you referring to?

The (classical) Latin alphabet can be fully described by the English alphabet.

What about people who do not ((speak English?) or (even use Latin letters?))
unicode names spit
if I want to name my file <turd emoji>.txt I damn well will
Any fule no that a file name is just an array of bytes (excluding the null byte and the slash). You can create a file with a name that is an invalid UTF-8 encoding. It's fun to see how much software chokes on that!
That’s called a “portable filename” in POSIX: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1...
TIL. Thank you!
If you're trying to avoid headaches then definitely don't allow -. At least not as the first character in a segment.

And allowing any letters from any language is probably worth the hassle.

I always joked about setting a custom keyboard layout to replace the space char with the underscore char specifically for avoiding spaces in file paths.