Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333475 - [Bidi] Project name containing mixed Arabic and English Text and Numerals display numerals in the wrong order
Summary: [Bidi] Project name containing mixed Arabic and English Text and Numerals dis...
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Components (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.components-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 09:32 EST by Maha Moustafa CLA
Modified: 2019-09-24 13:50 EDT (History)
7 users (show)

See Also:


Attachments
Sample Java project (1.14 KB, application/x-zip-compressed)
2011-01-04 09:59 EST, Maha Moustafa CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maha Moustafa CLA 2011-01-04 09:32:22 EST
Build Identifier: 20100917-0705

Project name containing mixed Arabic and English Text and Numerals display numerals in the wrong order.

Reproducible: Always

Steps to Reproduce:
1. Set system locale and language to Arabic-Egypt.
2. Open Eclipse IDE. Choose Arabic name for the workspace folder.
3. Choose Window>>Preferences>>General>>Workspace.
4. Change the text file encoding to UTF-8. Click OK to save the changes.
5. Create a new java project that has a title of the following series "ArabicEnglishNumberArabic".
6. Observe the project name in the project Explorer.


Expected Result:
Project name should be correctly displayed in the same order it was entered.

Actual Result:
Numerals are displayed at the end of the project name although this is not the order it should be displayed in.
Comment 1 Maha Moustafa CLA 2011-01-04 09:38:50 EST
Example project name is "واحدtwo3أربعة"
Comment 2 Dani Megert CLA 2011-01-04 09:42:25 EST
Can you please attach a sample project (or workspace) that shows it?
Does it work if you create a simple/general project?
Does it work in the Package Explorer?
Comment 3 Maha Moustafa CLA 2011-01-04 09:59:56 EST
Created attachment 186007 [details]
Sample Java project
Comment 4 Maha Moustafa CLA 2011-01-04 10:01:07 EST
It doesn't work if you create a simple/general project. This happens in the Package Explorer as well.
Comment 5 Markus Keller CLA 2011-01-04 12:40:34 EST
The rendering with "3" at the end is used everywhere in the Windows Explorer and in Eclipse (even in the Java Editor when I create a type with this name).
Comment 6 Dani Megert CLA 2011-01-05 03:16:15 EST
(In reply to comment #5)
> The rendering with "3" at the end is used everywhere in the Windows Explorer
> and in Eclipse (even in the Java Editor when I create a type with this name).

Maham, can you confirm that?
Comment 7 Markus Keller CLA 2011-01-05 06:06:28 EST
Notepad also puts 3 at the end, but Wordpad and Firefox render it as *two3*. Looks like a problem that should be solved in TextProcessor or its successor, if at all.

Moving to SWT, since this problem should also be addressed by the solution for bug 230854.
Comment 8 Maha Moustafa CLA 2011-01-05 06:36:00 EST
Comment 5 confirmed.
Comment 9 Lina Kemmel CLA 2011-01-05 07:41:03 EST
Notepad or SWT Text reorder text according to the bidi algorithm variant known as Windows-compatible algorithm, while Firefox, IE or Wordpad are compliant with the Unicode standard here.

It won't be possible to get the desired text appearance in a Text widget without using Unicode control characters.

An acceptable solution can be attaching a Segment Listener to the Text, so this bug likely depends on bug 230854.
Comment 10 Lina Kemmel CLA 2011-01-05 07:44:37 EST
Sorry - Markus already mentioned that this problem should also be addressed by the solution for bug 230854.
Comment 11 Lina Kemmel CLA 2011-01-05 09:57:29 EST
However, some work would have to be done also at the application level to trigger SegmentListener. So this bug has dependency - but won't be fully covered by bug 230854.
Comment 12 Felipe Heidrich CLA 2011-01-05 10:37:15 EST
You don't need bidi segments listener to solve this problem (in other words, you don't need bug 230854). The text in this case is read-only.

You need TextProcessor (?)

Please move this problem where it belongs. Thank you.
Comment 13 Markus Keller CLA 2011-01-05 12:18:39 EST
OK, moving to Equinox/Components, since the concrete case of label rendering is in TextProcessor (although any change there will make the rendering diverge from what is seen in the Text widget).

When I launch with -nl ar, the UI is RTL and TextProcessor is active, but the "3" is still rendered at the end. In this setup, the unprocessed name is rendered with "two3" in the middle but with "أربعة" on the left and "واحد" on the right. That's also how it looks like when I rename a file with such a name in the Windows Explorer and then press Ctrl+Right_Shift.
I don't know which form is to be considered "correct".

See also bug 229010 and bug 183164.
Comment 14 Lina Kemmel CLA 2011-01-19 06:34:32 EST
Sorry, I thought this bug was reported against an input field (it does exist there too though...).

As I understand it, it's related to the following Windows feature:
in *LTR* orientation, when an Arabic-European number is followed by an RTL character, the order of the two characters gets reversed in display.

paragraph level: 0
buffer: EN1R1
Windows-compatible display: R1EN1
Unicode standard-compatible display: EN1R1

If this is the problem indeed, to comply with the standard, we need to insert an LRM character (or add a bidi segment if SegmentListener is available) between the number and the RTL character. Unfortunately, TextProcessor won't help here (moreover, appearance in RTL/bidi locales, for which TextProcessor is enabled exclusively, is correct).
Comment 15 Lina Kemmel CLA 2011-01-19 06:38:55 EST
(In reply to comment #14)
> in *LTR* orientation, when an Arabic-European number is followed by an RTL
> character, the order of the two characters gets reversed in display.

This also happens in *RTL* orientation of course, but in that case it's standard-compliant.
Comment 16 Lars Vogel CLA 2019-09-24 13:50:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.