How to manage unicode LTR and RTL languages?

Sometimes we have to display messages that mix RTL and LTR. The message is in Unicode. So how does unicode handle mixing? Is there any platform dependency?

+4
source share
1 answer

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

By default, text is left to right (level 0). Unicode has special character codes for delimiting RTL text within level 0 (level 1). You use special characters to distinguish between LTR in RTL, etc. I think you can have up to 61 embed level.

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

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

+3
source

Source: https://habr.com/ru/post/1339603/


All Articles