Closed Bug 303406 Opened 19 years ago Closed 19 years ago

RTL unicode characters get scrambled when using in LTR direction

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED INVALID

People

(Reporter: z3r0eff3ct, Unassigned)

Details

(Keywords: rtl)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

How ya doin?

When using RTL direction unicode characters in the LTR direction, the characters
get scrambled with other surrounding characters. Actually this problem also
exists in IE, but I don't feel like going to their site to report it.

Here, make this page and save it as .html,

<html>
<head></head>
<body>
    &#1603;, 12ab
</body>
</html>

Notice, how the unicode character is before 12ab, but when you display it in the
browser you get this type of output:

12,&#1603;ab

Which is really strange.

Reproducible: Always

Steps to Reproduce:
1.It's in the details.

Actual Results:  
The characters were scrambled with surrounding characters.

Expected Results:  
Simply not scrambled the characters.

Yes, there is a discussion about this bug over here, with images:

http://www.vbulletin.com/forum/bugs35.php?do=view&bugid=907
What you are seeing is the correct rendering according to the Unicode Bidi
Algorithm: http://www.unicode.org/reports/tr9/

The Arabic letter is an RTL character, and therefore the following neutral (and
weak LTR) characters are displayed to its left. 
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
But that is not the bug. The bug is that when putting it in a standard LTR
direction, the other characters surrounding it are scrambled. Did you look
closely at the example I showed you and did you create the .html page? 

We want: &#1603;, 12ab

But we end up with: 12,&#1603;ab

Obviously, something is not right, do you not see a 12 in front in the second
example? How can that possibly be a standard?
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Yes, I created the HTML page, and I saw what you describe. Once again, this is
the correct behaviour. RTL characters affect the ordering of neutral (such as
punctuation marks) and weak-type (such as digits) characters surrounding them,
even in LTR context.

I'm guessing you are not a speaker of an RTL language (such as Hebrew or
Arabic). Had you been such, you would understand why this behaviour is not only
according to the standard, but is also logical.

If you really want to have the RTL character at the left, you'll have to use an
LRM character: &#1603;&#8206;, 12ab.

Please don't re-open this bug unless you can point the exact rule in the Unicode
bidi algorithm which you think Firefox is not following.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → INVALID
Attached file testcase
Attachment #191598 - Attachment mime type: text/plain → text/html
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: