You are viewing a single thread.
View all comments View context
46 points

Unicode in filenames? Are you crazy?!

Okay that was /s to some extent but I gotta rant, I’m totally convinced that there’s still new software today that completely trip over themselves when files or paths have non-ASCII characters, or sometimes even a space. Incompetence didn’t go anywhere.

permalink
report
parent
reply
29 points

I still use underscores for filenames, basically muscle memory at this point

permalink
report
parent
reply
11 points

Spaces in file names will always be fiddly though. It’ll work, but it’ll still be wrong, because arguments are space separated, and having spaced file names totally messes with that.

permalink
report
parent
reply
5 points
*

I try to just always put files names or paths into quotes in CLI or tie it to a variable in programming. This way it also accepts spaces and knows how to separate it from arguments.

permalink
report
parent
reply
16 points

Unicode in filenames can be a bad idea, since there are more than one way to achieve what looks like the same character. So matching patterns could fail if you think it’s one way, but it’s actually another representation in unicode.

permalink
report
parent
reply
5 points

Good point. Do filesystems use a normal form to at least prevent having two files with effectively the same name?

I should point out the flip side though, that there’s no avoiding Unicode in filenames. Users in languages that don’t use the Latin alphabet (such as Japanese, Chinese, Korean, Hebrew, Arabic, Greek and Russian, and the list could go on) can reasonably expect to be able to give a file a name they can read and understand with no extra effort. All the software woes that come with it - too bad, software needs to deal with it.

permalink
report
parent
reply
2 points

I’m not sure. A few years ago I remember that OpenBSD expected ASCII for files, but I think Linux expects utf-8. I could be wrong though.

permalink
report
parent
reply
10 points

Incompetence didn’t go anywhere.

Now that’s certainly true, but the beauty of open source software is that we can fix bugs when we encounter them.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 5.3K

    Monthly active users

  • 884

    Posts

  • 8.9K

    Comments

Community moderators