How mixing LTR and RTL languages is managed in unicode?

1.6k views Asked by At

Sometimes we have to show messages in display which is a mixing of RTL and LTR languages. The message is in unicode. So, how unicode handle the mixing? Is there any dependency on the platform?

1

There are 1 answers

0
Jimmy On BEST ANSWER

The process is described by the Unicode bidirectional algorithm described here: http://www.unicode.org/reports/tr9/.

By default, text is left to right (level 0). Unicode has special character codes to delimit RTL text within level 0 (level 1). You use special characters to delimit LTR within RTL and so on. I think you can have up to 61 levels of embedding.

HTML tags have the "dir" attribute to specify the default direction.

The process is platform neutral, but you will be relying on the unicode algorithm to get it right.