Hacker News new | past | comments | ask | show | jobs | submit login

How are users supposed to write "עבור אל duckduckgo.com כדי לחפש באינטרנט" without \u202E? It's perfectly normal for RTL languages to switch text direction in the middle of a sentence.



That should just render correctly thanks to the BiDi algorithm. The "override" control characters are a heavy hammer, and are extremely rarely needed. In fact, at this point I think it's likely that malicious use of these code points significantly outweighs correct use.

There are legitimate uses of BiDi control characters. My favorite one from my time on Android was the string "Google+", which would render as "+Google" in an RTL paragraph. The translators would usually "fix" this by just flipping the string so that it was "+Google", which would render correctly, but be incorrect when cut'n'pasted, read by a screen reader, etc. The correct solution is to use a left-to-right mark. The string "Google\u{200e}+" renders correctly in both LTR and RTL flow. And these "mark" characters are basically harmless, they cannot profoundly change the order, they just fix some of these ambiguous cases.

Correct use of BiDi control characters is explained here: https://www.w3.org/International/questions/qa-bidi-unicode-c...


And then you get Arabic and English text quoted in Japanese vertical RTL text and that's the story of how I actually died.


Do you read left RTL, middle LTR, right RTL; or right RTL, middle LTR, left RTL? (Just curious.)


Imagine it was the other way around: like you wanted to reference תֵּל־אָבִיב-יָפוֹ in the middle of an English sentence. That, but reversed.


It is different though, because with LTR RTL LTR:

1) once you've read the first LTR you end in the right place for the RTL

2) even if you consider the LTRs to be two distinct documents it doesn't change the order. I can imagine the LTR 'breaking' the RTL text such that the sections are treated separately.

But I understand what you were saying, so thanks for the answer!


On 1, no you’re not. After the first LTR you’re at the end of the RTL.

On 2, I’m not sure I understand. The situation is the same for both primary directions.


> Do you read left RTL, middle LTR, right RTL; or right RTL, middle LTR, left RTL? (Just curious.)

YES.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: