Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>But for whatever reason, when it is suggested, you get many people chiming in that "filenames should be dumb bytes, anything allowed except / !"

I guess the issue is not what filenames should be, but what filenames are. In general, when interacting with files, you have to expect everything but `/` and nullbyte. Even if you forbid it on your machine, someone may mount a NFS drive and open you to the world of weird filenames. And you never know who uses your code.

And the unicode itself is weird anyway - for example you may have normalised and denormalised names which may be the same or different string depending on how you look at them[1]. And I hope you are not planning to restrict filenames to some anglocentric [a-z0-9_- ]*, because the world is much larger and you can't pretend unicode doesn't exist.

[1] https://eclecticlight.co/2017/04/06/apfs-is-currently-unusab... and many other cases



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: