3 ms·
It's not just Unicode weirdness, it's the whole concept of string operations. Examples: 1) Naive CSV libraries that break when given a field containing a comma
by BoppreH 7y ago
It's not just Unicode weirdness, it's the whole concept of string operations. Examples:
1) Naive CSV libraries that break when given a field containing a comma itself. Same for injections.
2) Indexing things by strings (file names, user names, etc) relies on humans typing and reading with 100% accuracy.
3) Control characters are still present. Try to generate a file name containing every ASCII character (from 0x01 to 0x7F), then try to delete it in different ways. It's really frustrating.
4) Even string templates can cause problems. MMO's used to have game masters identified with "[GM] Character name", until scammers started using the same pattern. The sin here was to concatenate "[GM] " with the character name, which is spoofable, instead of using a badge or different color.
- ChrisSD 7y agoFor 3), that's not the case on Windows filesystems as these characters are not allowed in file and folder names. On Linux, in addition to control characters, the shell interprets the `-` character specially. This means that if a filename starts with `-` you may have surprising results even if the filename is quoted.
- nybble41 7y ago> On Linux, in addition to control characters, the shell interprets the `-` character specially. It's not the shell that interprets the leading `-` character specially, but rather the program receiving the string. The convention of marking the end of option processing with `--` helps, for programs that support it; you can also prefix relative paths with `./`.