RE: Two bidi questions

From: Marco Cimarosti (marco.cimarosti@essetre.it)
Date: Thu Jul 05 2001 - 12:30:25 EDT


Lars Marius Garshol wrote:
> The second question should be really easy.

So, I'll get this one. :-)

> On
>
> <URL: http://www.unicode.org/unicode/standard/WhatIsUnicode.html >
>
> on the upper left, there is some text saying (in logical order):
>
> WHAT IS "UNICODE"? in arabic
>
> As I understand the bidi algorithm, this should be rendered
>
> in arabic ?"EDOCINU" SI TAHW
>
> This is what my application does, and an Arab speaker has confirmed to
> me that this is correct. MSIE 5.5, however, displays this as
>
> ?"EDOCINU" SI TAHW in arabic
>
> Which is correct? My understanding of both the bidi algorithm and of
> how to read bidi text says that this (by the bidi rules) is a
> predominantly RTL paragraph, and thus should be read ARABIC first,
> then english.

Don't forget that HTML is a form of *rich* text, implementing a higher-level
protocol.

And keep in mind that the Unicode bidirectional algorithm is a *default*
behavior that should be honored only when no higher-level bidi protocol is
in action. This is specified in section "Higher-Level Protocols" in:

        
http://www.unicode.org/unicode/reports/tr9/#Bidirectional_Conformance

I am not sure whether IE is right or wrong but, anyway, you cannot tell it
by looking at the Unicode Bidi Algorithm: it is the bidirectional
specifications of *HTML* that rule here.

The relevant section for HTML bidi is:

        http://www.w3.org/TR/html4/struct/dirlang.html#h-8.2

A specific section about tables directionality is:

        http://www.w3.org/TR/html4/struct/tables.html#table-directionality

The source code of the portion of text that you mentions looks like this:

        <td valign="top" class="navColCell">
                <a href="translations/arabic.html">...ا ?S ا"شفرة
ا"...^حدة &quot;S^?ِf^د&quot; Y</a>
                in Arabic</td>
        </tr>

So, the Arabic text is the *caption* of an hyperlink enclosed inside a table
*cell*.

As I understand it, the basic HTML rule is that inner tags inherit their
directionality from outer tags, and NOT vice versa. So, the outer <td> tag
does not get the directionality of the inner <a> tag. So, if I got it right,
I am sad to admit that IE is correct.

The effect that you want may be obtained by explicitly making the cell RTL.
Try downloading the page and changing the cell like this:

        <td dir="RTL" valign="top" class="navColCell">
                <a href="translations/arabic.html">...ا ?S ا"شفرة
ا"...^حدة &quot;S^?ِf^د&quot; Y</a>
                in Arabic</td>
        </tr>

It works. But, personally, I find it very ugly. To me, the current behavior
is what should be expected in an English document containing an occasional
Arabic phrase.

Also if this was a plain text document, I would have enclosed the Arabic
text between RLE and PDF to achieve the same effect: "in Arabic" on the
right side and the paragraph aligned on the left side.

_ Marco



This archive was generated by hypermail 2.1.2 : Fri Jul 06 2001 - 13:48:07 EDT