by amelius · 4y ago · 0 comments
So every programmer has to know about and support U+202E, but not filesystem programmers?
Note that U+202E is a control code that has effect on display, not the logical order of the text (much like, say, a bare CR), so I can’t say what the filesystem is doing wrong here (except maybe for not rejecting this outright, but see re smarts above, this probably needs to be done on a higher level). You don’t blame the filesystem for believing the filename "A\rB.txt" starts with A and not B, do you? Even though ls will say otherwise.
Bidi IRIs (which are at that higher level) are kind of horrendous, though.
Replace:
if(bytestring_ends_with(filename, ".exe")) execute_file(...);
By: if(last_displayed_glyphs_equal(filename, ".exe")) execute_file(...); if (!isascii(c)) panic("stupid user"); если (!кои(с)) авост(«тупой оператор»);
You wouldn’t want to live in that world, would you? I know I wouldn’t, and I have that as my native script and most of my filesystem in Latin. I’ve spent my childhood with a computer that ran a VGA-chargen-reprogramming hack at startup and later had to maintain a website stored in an encoding designed to preserve legibility after Latinization through amputation of the 8th bit (in case you’ve ever wondered where the illogical order of KOI-8 comes from). I do not want that world back, however fondly I remember my 286.