Right-to-Left and Left-to-Right printed nicely

Put a Right-to-Left Embedding character, u'\u202B', at the beginning of each Hebrew word, and a Pop Directional Formatting character, u'\u202C', at the end of each word.

This will set the Hebrew words apart as RTL sections in an otherwise LTR document.

(Note that while this will produce the correct output, you’re also dependent on the terminal application in which you’re running this script having implemented the Unicode Bidirectional Algorithm correctly.)

Leave a Comment