This page contains examples using non-Latin characters. Use accesskey "n" to jump to the internal navigation links at any point. Right now you can skip to:

Go to W3C Home Page Go to Architecture Domain home page. Go to Internationalization Activity home page.

FAQ: Misplaced parentheses and quotes  in bidi texts

Question

Why some of my parentheses, brackets and quotes are misplaced in latin Arabic text? Why they change from open/close symbol to close/open symbol?

Background

Quotes between Latin and Arabic/Hebrew text may appear misplaced.

For example:

<p dir="rtl">العبارة echo "Hello" تعني</p>

Would produce a result that looks as follows,

image1

where the ending quote has suddenly moved to a strange place. In fact it is still at the  same place: BEFORE  the arabic word (underlined) that comes after it when displayed in  RTL context.

Note that this effect also occurs in the inverse example where quotes suround an Arabic word.

<p> The expression اعلن ‎ "اهلا" means </p>

would produce this wrong display

image2

As in the above example, the ending quote is still before the word "means"  when displayed in LTR context

Answer


The short answer is, because there are ambigous contexts where a symbol can be interpreted as Arabic or as Latin.

Symbols like parenthesis ,brakets, quotes etc  that are pairly used to delimt a word or a phrase, are punctuation symbols and thus are considered of neutral  directionnality. In a full LTR contexte, i.e. is in the middle of LTR text, the symbol is then Latin and it behave normally.  But when the symbol is between words with different directionnality, the ambiguity arise.
Moreover,  () ))

Subtitle

bla bla ...

By the way

bla bla ...

Useful links


Contributed by Najib Tounsi, Mohammadia school of engineers, Rabat.

Valid XHTML 1.0! Valid CSS!Encoded in UTF-8!

Content created 7 June, 2004.