1

And how does the OS know whether to apply bidi algorithms on the string for displaying purposes?

I know that Hebrew might come in an ISO-Logical form, but how does the OS know how to point that a specific string contains Hebrew (or any other RTL language)?

j0k
  • 22,600
  • 28
  • 79
  • 90
Shai
  • 25,159
  • 9
  • 44
  • 67

2 Answers2

2

According to How to detect whether a character belongs to a Right To Left language? - it seems they are stored left-to-right, and it's the character codes that dictate whether it's a RTL language.

Community
  • 1
  • 1
Tass
  • 1,238
  • 11
  • 21
0

The way to do this nowadays, as recommended by the Unicode standard, is to store text in logical order (good explanation here), which means the order in which it is read.

The OS knows that a specific string contains Hebrew by looking at the character codes. It applies the Unicode Bidirectional Algorithm to determine the correct display order. Typically an OS will do a quick scan of the string first to see if there are any right-to-left characters or control codes constraining the order. If not, the string doesn't need reordering.

Graham Asher
  • 1,648
  • 1
  • 24
  • 34