B.119. unicode-bidi

Most western languages are written left-to-right (LTR). As you probably know, many other languages (e.g. Hebrew) are written right-to-left (RTL). Documents written with the Unicode character set can contain text from both LTR and RTL languages. The Unicode standard includes a complicated algorithm that should be used for displaying such mixed text. It also defines special characters that let you "group" text.

For example, consider the following imaginary string of text, where the lowercase text represents LTR characters and the uppercase text represents RTL:

english1 HEBREW1 english2 HEBREW2 english3

Now, the obvious way to render this would be "english1 1WERBEH english2 2WERBEH english3", but what if we add some HTML ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.