How to detect whether a character belongs to a Right To Left language?

Unicode characters have different properties associated with them. These properties cannot be derived from the code point; you need a table that tells you if a character has a certain property or not. You are interested in characters with bidirectional property “R” or “AL” (RandALCat). A RandALCat character is a character with unambiguously right-to-left directionality. … Read more

NameError: global name ‘unicode’ is not defined – in Python 3

Python 3 renamed the unicode type to str, the old str type has been replaced by bytes. if isinstance(unicode_or_str, str): text = unicode_or_str decoded = False else: text = unicode_or_str.decode(encoding) decoded = True You may want to read the Python 3 porting HOWTO for more such details. There is also Lennart Regebro’s Porting to Python … Read more