qutim
qutim copied to clipboard
Bidirectional text support
Support for the positioning of characters in text containing characters flowing from right to left.
From: http://www.unicode.org/reports/tr9/
This annex describes specifications for the positioning of characters in text containing characters flowing from right to left, such as Arabic or Hebrew.
3.3.1 The Paragraph Level
P1. Split the text into separate paragraphs. A paragraph separator is kept with the previous paragraph. Within each paragraph, apply all the other rules of this algorithm.
P2. In each paragraph, find the first character of type L, AL, or R.
Because paragraph separators delimit text in this algorithm, this will generally be the first strong character after a paragraph separator or at the very beginning of the text. Note that the characters of type LRE, LRO, RLE, or RLO are ignored in this rule. This is because typically they are used to indicate that the embedded text is the opposite direction than the paragraph level.
P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero.
The meaning of "embedding level" is the direction of the paragraph: if embedding level is even, the paragraph is written from left to right and if it is uneven,the paragraph is written from right to left.
There is also realization ascription at:
http://unicode.org/cldr/utility/bidi.jsp
With it you can see what is the correct behavior.
This information was shared under the auspices of Eli Zaretskii
Gajim project has a patch (was not released yet) that works only for regular messages Thread https://trac.gajim.org/ticket/7284 Issues https://trac.gajim.org/wiki/BiDi