Re-posted to fix my filename emoji. You can’t make this shit up

  • NeatNit@discuss.tchncs.de
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    2 days ago

    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.

    • AnarchistArtificer@slrpnk.net
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 day ago

      I was already interested based on your first comment but this:

      “The UBA is a masterpiece, and I’m not being sarcastic.”

      has thoroughly piqued my interest. Thank you for being an opinionated nerd on the internet.