I need to create a table in reportlab with text in RTL languages like Arabic and Hebrew as well as LTR languages such as English.
Following to this post, I'm adding the Unicode Character 'RIGHT-TO-LEFT EMBEDDING' (U+202B) at the beginning of each Arabic/Hebrew word, and the Unicode Character 'POP DIRECTIONAL FORMATTING' (U+202C) at the end of each word.
So the Arabic word 'مرحبا' will be like this:
u'\u202B\uFEE3\uFEAD\uFEA4\uFE92\uFE8E\u202C'
And similarly the Hebrew word 'שלום' will be like this:
u'\u202B\u202E\u05e9\u05DC\u05D5\u05DD\u202C'
Unfortunately, in my table in the reportlab produced PDF, the word still comes out reversed: 'ابحرم' and 'םולש'
(Nb. I also tried adding the Unicode Character 'RIGHT-TO-LEFT MARK' (U+200F) before the RTL characters, like this:
print u'\u200F\uFEE3\uFEAD\uFEA4\uFE92\uFE8E'
following this post
But the result is the same :()
Also when I use ipython to print this unicode string, the text will come out reversed:
print u'\uFEE3\uFEAD\uFEA4\uFE92\uFE8E'
ابحرم
print u'\u202B\u202E\u05e9\u05DC\u05D5\u05DD\u202C'
םולש
How can I get the Arabic and Hebrew text come out right?
Nb. I checked PythonBidi and PyFriBidi, but I don't want to use these libraries.