NeatNit

joined 2 years ago
[–] NeatNit@discuss.tchncs.de 1 points 2 months ago* (last edited 2 months ago)

I'm most cases, a consecutive run of RTL or neutral characters would be rendered RTL, while the rest would be rendered LTR. However, if it's within a RTL paragraph, this would be reversed.

For example, the following two paragraphs have the same path, but the surrounding text is translated:

Open C:\Users\אדם\Documents\דברים\מסמך.pdf and click "Sign".

פתח את C:\Users\אדם\Documents\דברים\מסמך.pdf ולחץ על "חתימה".

Depending on your client, these should be rendered differently. If they don't, click here to see it: https://jsfiddle.net/jex3yfrw/

Edit: looks like Voyager needs a bug report! The web Lemmy seems to render it RTL (correctly) but still left-aligned which is not ideal.

[–] NeatNit@discuss.tchncs.de 4 points 2 months ago (2 children)

I'm not sure, as I've never used them. But I imagine this is a lot more straightforward.

The problem with bidirectional text is that it's bi-directional. Parts of it are RTL and parts are LTR. The main problem is how to order the characters visually, assuming that they are stored in memory in the order in which they are intended to be read.

For text that goes in only one direction this is trivial. LTR: characters are arranged from left to right. RTL: characters are arranged from right to left. Easy peasy!

The problem, as I've said, is when you have a sentence or paragraph with both LTR and RTL text inside it. Then the algorithm is needed.

To my knowledge, there is no bottom-to-top language, and certainly not one that would be mixed in within top-to-bottom text or vice versa. So an algorithm isn't necessary: if TTB (top-to-bottom) is used, characters simply need to be arranged top to bottom.

To add on to this, I believe TTB text is only used explicitly. By default, all text is rendered horizontally (usually LTR) unless you explicitly set the software to render it top-to-bottom. So if you just have plain text in Japanese or whatever language with no additional markup, it will be rendered horizontally and subject to the UBA.

[–] NeatNit@discuss.tchncs.de 13 points 3 months ago* (last edited 3 months ago) (1 children)

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.

[–] NeatNit@discuss.tchncs.de 15 points 3 months ago (1 children)
[–] NeatNit@discuss.tchncs.de 106 points 3 months ago* (last edited 3 months ago) (19 children)

You complain about ASCII filenames but a few of the examples are obviously Unicode, namely using emoji, well outside of the ASCII character set. But since you've brought up Unicode file names, let me introduce you to bidirectional text!

If you use Hebrew or Arabic, some of your directories or files will have right-to-left text in them. This is a recipe for disaster.

If in English you'd have "C:\Users\Adam\Documents\Research\Paper.pdf", which breaks down to:

  1. C:\
  2. Users\
  3. Adam\
  4. Documents\
  5. Research\
  6. Paper.pdf

In Hebrew you'd have: "C:\משתמשים\אדם\מסמכים\מחקר\מאמר.pdf", which breaks down to:

  1. C:\
  2. משתמשים\
  3. אדם\
  4. מסמכים\
  5. מחקר\
  6. מאמר.pdf

The entire path goes backwards, and the ".pdf" extension is visually attached to the "Users" folder if the text is rendered naively. It's insane. Fortunately many GUI shells nowadays separate each path item so they can't get intermixed like this. Example:

But still, if you copy a path into plaintext, it will still visually look wrong, and there is literally nothing that anyone can do about it. This is the correct way to render this text.

Exact same issues occur in Arabic and the few other RTL languages usedin the world. It's a massive pain.

Edit: oh, and on commandline on Windows, the required characters aren't even available by default so you get this lovely thing

[–] NeatNit@discuss.tchncs.de 0 points 3 months ago (1 children)

Does this break games? Where in the input pipeline is the long press converted to shift? Being in the firmware implies that it's in the keyboard itself, so even games wouldn't be able to see that you're just holding W to go forwards.

[–] NeatNit@discuss.tchncs.de 4 points 3 months ago

Why not?

It's mostly a big desert so no land of great value is lost. And it has to be on land, doing this in the ocean would be impractical and crazy!

[–] NeatNit@discuss.tchncs.de 6 points 3 months ago

The original statement is still vacuously true so your can keep saying it :D

[–] NeatNit@discuss.tchncs.de 7 points 3 months ago

Depends how you count. Both : and ! require shift as well.

[–] NeatNit@discuss.tchncs.de 14 points 3 months ago

I see no downside there

[–] NeatNit@discuss.tchncs.de 2 points 3 months ago (1 children)

I find it odd that natural disaster isn't on your list considering it's by far the most realistic scenario. Hell, it's already happening.

I guess the word "natural" isn't very accurate for a climate disaster, but still, it's not on your list.

view more: ‹ prev next ›