The way this should work is it’s set as either left-to-right or right-to-left. (C:)/1/2/3.ext or ext.3/2/1/(:C). It shouldn’t render part of it one direction and part of it the other direction logically. It’s probably impossible to fix at this point, but this makes a lot more sense.
Yeah, that is pretty much how it works in some GUIs like in the screenshot, where each slash is replaced by >. But if you represent the path in a string, and put that string in some context that doesn’t know it’s a path and that it should be rendered by some special rules, then it’ll just be subject to the usual Unicode Bidirectional Algorithm (UBA).
The UBA is a masterpiece, and I’m not being sarcastic. For everyday text with mixed directionality, such as a WhatsApp chat in Arabic/Hebrew with a bit of English or just some numbers mixed in, the UBA’s default output is the ideal way to order the characters.
The problem is, special cases (such as file paths) just can’t be covered by a universal algorithm. You can insert special characters into the path, namely FSI and PDI (“First Strong directional Isolate” and “Pop Directional Isolate”) to make the text render the way you want under the UBA… But then, when you copy that path, the special characters would still be there so software would consider them part of the path, and then of course, File Not Found.
The way this should work is it’s set as either left-to-right or right-to-left. (C:)/1/2/3.ext or ext.3/2/1/(:C). It shouldn’t render part of it one direction and part of it the other direction logically. It’s probably impossible to fix at this point, but this makes a lot more sense.
Yeah, that is pretty much how it works in some GUIs like in the screenshot, where each slash is replaced by
>
. But if you represent the path in a string, and put that string in some context that doesn’t know it’s a path and that it should be rendered by some special rules, then it’ll just be subject to the usual Unicode Bidirectional Algorithm (UBA).The UBA is a masterpiece, and I’m not being sarcastic. For everyday text with mixed directionality, such as a WhatsApp chat in Arabic/Hebrew with a bit of English or just some numbers mixed in, the UBA’s default output is the ideal way to order the characters.
The problem is, special cases (such as file paths) just can’t be covered by a universal algorithm. You can insert special characters into the path, namely FSI and PDI (“First Strong directional Isolate” and “Pop Directional Isolate”) to make the text render the way you want under the UBA… But then, when you copy that path, the special characters would still be there so software would consider them part of the path, and then of course, File Not Found.
I was already interested based on your first comment but this:
has thoroughly piqued my interest. Thank you for being an opinionated nerd on the internet.
(:-C) boah or (C:) nose?