Q:

How are numbers encoded in unicode with right-to-left languages? (Normalisation)

During an Information Retrieval lecture, there were slides talking about the lemmatisation and/or normalisation of tokens for indexing and querying text documents. One of those mentioned right-to-left languages such as Arabic, but in unicode they're encoded logically/sequentially in the same manner as left-to-right languages, just displayed right-to-left. This makes sense, but how are numbers encoded (in particular those using Roman Numerals)?

In the English, the year "1962" would have the characters encoded sequentially as 1962 with unicode and most other character encodings. However, in Arabic, it's unclear whether the year "1962" as shown in the lecture slide would be encoded sequentially as 1962 and then rendered left-to-right (so the document is technically bidirectional), or encoded as 2691 and rendered right-to-left as the text would be.
This matters for indexing so that the year 1962 in Arabic and English texts are both the same token in an index. Do I need to reverse the characters from in the Arabic language to normalise them, or are they encoded in the same order as English?

A:

I think I found the answer with Unicode Bi-Directional Text. Unicode is meant to be encoded logically as opposed to the order it's rendered in, thereby the rendering algorithm can still perform line breaks correctly for different paragraph widths (and also explains why right-to-left support sometimes needs to be explicitly enabled, since it's more complex to render).
From wikipedia, it appears that unicode groups characters into four types of "orders": strong, weak, neutral, and explicit. Numbers fall under the weak ordering as they have a vague directionality. From wikipedia:

Unless a directional override is present numbers are always encoded (and entered) big-endian, and the numerals rendered LTR. The weak directionality only applies to the placement of the number in its entirety. (1)

Therefore as far as I understand, the number "1962" should be encoded in the same logical order (1962) in a typical left-to-right string as it would be in a string with right-to-left characters.

