This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 65158 - I18N - IDE does not handle arabic text properly
Summary: I18N - IDE does not handle arabic text properly
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0
Hardware: All All
: P2 blocker (vote)
Assignee: centurions1195
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2005-09-27 06:59 UTC by mabasara
Modified: 2013-03-26 09:23 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project that demonstrates the problem (9.88 KB, application/x-compressed)
2005-09-27 07:04 UTC, mabasara
Details
Arabic text support in Netbeans 5.5 (47.27 KB, application/octet-stream)
2007-02-25 08:38 UTC, mabasara
Details
Movie showing the arabic selection in the output window (407.41 KB, video/quicktime)
2011-08-18 19:31 UTC, emi
Details
Example IDE does not handle arabic text properly (9.38 KB, image/png)
2012-03-09 20:41 UTC, anan.adel
Details
no arabic language (457.50 KB, application/octet-stream)
2012-09-01 15:06 UTC, Maher_Almaktry
Details
persian/arabic text problem (189.53 KB, application/zip)
2013-02-13 13:44 UTC, centurions1195
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mabasara 2005-09-27 06:59:21 UTC
This sample code will better explain the problem:
/**
 * The Output window shows the arabic text corrupted. It seems that it uses
 * the ISO8559-1 character set. 
 * 
 */
public class Main
{
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        // notice here that I have typed the arabic text first but the editor
        // missplaced it while I'm typing. However, when you run the program
        // it will be displayed in the right order.
        System.out.println("نص عربي\t Arabic Text");
    }
}
Comment 1 mabasara 2005-09-27 07:04:39 UTC
Created attachment 25211 [details]
sample project that demonstrates the problem
Comment 2 Milan Kubec 2005-09-27 14:49:52 UTC
Reassigning for evaluation.
Comment 3 Miloslav Metelka 2005-09-27 17:08:32 UTC
We are unable to handle the LTR and RTL mixing of the text properly yet.
Setting target milestone to future for now.
Comment 4 Miloslav Metelka 2005-10-11 15:29:34 UTC
I'm making a FEATURE from this issue as we need to review the present support
for RTL text in the javax.swing.text package and make a planning of how and when
we will implement it.
Comment 5 Ken Frank 2007-02-21 19:19:03 UTC
Is this something that can be looked at again for nb6 timeframe ?

ken.frank@sun.com
Comment 6 Vitezslav Stejskal 2007-02-22 01:53:54 UTC
I personally can see two issues in this report:

1. LTR/RTL text handling in editor
2. Output window not showing the arabic characters properly

Is that right? If so, I would suggest to leave this issue for tracking #1 and
file another one for core/output to fix #2. They are indepenedent issue, fixes
need to be done in completely different modules, the complexity of the fixes is
likely to be different and therfore their timeframe is probably going to be
different too.
Comment 7 Ken Frank 2007-02-22 02:21:00 UTC
I can file the 2nd issue - can the filer of issue confirm there is problem also
with how arabic is shown in output window and include a gif ?

Also, there is another separate possible issue about window applications
created using form designer in that, for menus at least, they are not shown
as per locale without additional kind of coding needed - ie they
are shown left to right as in en or other locales and not rtl as
should be in arabic locale.

This might be jdk issue since seems to need to give the explicit api
of text direction, but dont know its a bug in jdk or if its expected,but it
seems that for nb, it should provide code for user that takes care of this
and as per locale. Am investigating and can file something on form designer.

ken.frank@sun.com
Comment 8 mabasara 2007-02-25 08:38:46 UTC
Created attachment 38888 [details]
Arabic text support in Netbeans 5.5
Comment 9 mabasara 2007-02-25 08:40:53 UTC
I found out that the IDE prints the Arabic text correctly and in the right 
order after I set my OS (Windows XP) locale to "Arabic (Saudi Arabia)". I've 
tried different combinations of mixed Arabic and English text and the result 
was just fine. The remaining issue now is with the editor itself. Manipulating 
Arabic text is still difficult. To give an example,  if you try to highlight 
an Arabic character, you have to guess its position on the line. 
A snapshot has been attached [nb5.5_arabic_support.gif].
Comment 10 Ken Frank 2007-02-25 17:08:53 UTC
see also 96333 and 96472 related to having ide/platform and form editor use
the locale user is in for determining orientation of menus and other applicable
ui objects as to right to left or left to right layout.

ken.frank@sun.com
Comment 11 Vitezslav Stejskal 2007-02-25 21:26:27 UTC
Ok, so just to clarify, the #2 is working fine. Thanks for the report.
Comment 12 mabasara 2007-02-27 06:54:51 UTC
I believe that issue number 2 is not a problem anymore. However, I suggest to 
have it configurable on the IDE level or even on the project level. Because, 
sometimes, I need to work on projects that support Arabic while I want to keep 
my OS locale set to English. Be aware that eclipse does not have this problem. 
In eclipse, you can set the encoding on the project level. Thanks.
Comment 13 salahaa1 2011-04-18 09:47:18 UTC
In php files and html files 
all texts in arabic are hard to select and hard to modify ,
the text is just chaos.

IDE does not handle arabic text properly
Comment 14 emi 2011-05-26 08:08:35 UTC
Is this issue still under development (I see it has a "started" status)?

It seems to me selection has issues with mixed arabic-english text, possibly char deletion too.
Comment 15 Miloslav Metelka 2011-08-16 14:43:05 UTC
(In reply to comment #14)
> Is this issue still under development (I see it has a "started" status)?
Yes, there was a replacement of view hierarchy (text rendering mechanism) so things might change due to that.

> It seems to me selection has issues with mixed arabic-english text, possibly
> char deletion too.
Could you please download a recent Dev build and describe in steps the main problems? Thanks.
Comment 16 emi 2011-08-18 19:31:32 UTC
Created attachment 110094 [details]
Movie showing the arabic selection in the output window

The attached QuickTime movie shows the text selection in a recent dev build.

Selection in the editor is a bit different, but still looks incorrect.
Comment 17 anan.adel 2012-03-09 20:41:36 UTC
Created attachment 116525 [details]
Example IDE does not handle arabic text properly

Example IDE does not handle arabic text properly
Comment 18 Miloslav Metelka 2012-08-22 09:42:53 UTC
I'll attempt to fix the problem in 7.3 by using getLogicalRangesForVisualSelection() in TextLayout and related methods in case TL.isLeftToRight() returns true.
Comment 19 Maher_Almaktry 2012-09-01 15:06:15 UTC
Created attachment 123798 [details]
no arabic language
Comment 20 whitefawn 2012-12-26 04:35:44 UTC
Miroslav, good luck, I can test it if you want.
Comment 21 Miloslav Metelka 2013-01-10 14:48:00 UTC
(In reply to comment #17)
> Created attachment 116525 [details]
> Example IDE does not handle arabic text properly
> 
> Example IDE does not handle arabic text properly

Could you please paste the text from the attached picture into the issue so that I can paste it into NB for testing? Thanks.
Comment 22 Miloslav Metelka 2013-01-24 13:49:06 UTC
I've tried several unsuccessful solutions but finally I had to resign on using mixed text capabilities of TextLayout and split a text containing RTL sections into multiple text layouts (JDK's plain text eidtor uses similar approach). I've also improved getNextVisualPosition() of the views.

I do not close the issue yet - once the fix appears in dev builds I'll first need testing from someone using RTL languages daily.
I only test by iterating over the following text:

        System.out.println("نص عربي\t Arabic Text");

http://hg.netbeans.org/jet-main/rev/82a545b61c94
Comment 23 whitefawn 2013-01-24 13:53:22 UTC
Miloslav,
How can I see when there will be a development build that includes this fix?



(In reply to comment #22)
> I've tried several unsuccessful solutions but finally I had to resign on using
> mixed text capabilities of TextLayout and split a text containing RTL sections
> into multiple text layouts (JDK's plain text eidtor uses similar approach).
> I've also improved getNextVisualPosition() of the views.
> 
> I do not close the issue yet - once the fix appears in dev builds I'll first
> need testing from someone using RTL languages daily.
> I only test by iterating over the following text:
> 
>         System.out.println("نص عربي\t Arabic Text");
> 
> http://hg.netbeans.org/jet-main/rev/82a545b61c94
Comment 24 Quality Engineering 2013-01-25 03:02:03 UTC
Integrated into 'main-golden', will be available in build *201301250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/82a545b61c94
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #65158 - I18N - IDE does not handle arabic text properly.
Comment 25 whitefawn 2013-01-25 17:12:54 UTC
It's better. I've created screen capture to illustrate some problems in current build. ://www.youtube.com/watch?v=_8NS1ggDQZU&feature=youtu.be

Thanks for watching :)
Comment 26 280Z28 2013-01-28 02:41:16 UTC
The "jumping" effect you demonstrated for Hebrew text are present for regular English text as well. In a Java source file that uses hard tabs, selecting a few lines and pressing tab (which indents those lines) is causing *really* weird effects.
Comment 27 whitefawn 2013-01-28 05:30:55 UTC
(In reply to comment #26)
> The "jumping" effect you demonstrated for Hebrew text are present for regular
> English text as well. In a Java source file that uses hard tabs, selecting a
> few lines and pressing tab (which indents those lines) is causing *really*
> weird effects.

So the bug should be easier to fix.

There is one other bug which is shown when trying to type word "אחד" (one) and then pressing Enter - the order of characters breaks.
Comment 28 Miloslav Metelka 2013-01-28 14:17:07 UTC
Apologies the "jumping text", it's already fixed (today) as issue #225347.
Once the "Integrated into 'main-golden' ..." message appears for 225347 could you please download the particular dev build and re-test the things? Thanks.
Comment 29 whitefawn 2013-01-31 21:39:13 UTC
(In reply to comment #28)
> Apologies the "jumping text", it's already fixed (today) as issue #225347.
> Once the "Integrated into 'main-golden' ..." message appears for 225347 could
> you please download the particular dev build and re-test the things? Thanks.

I checked 20130131 , there are no jumping test or characters changing places.
Comment 30 Miloslav Metelka 2013-02-05 13:55:50 UTC
So marking as fixed. If there would be any more related problems please reopen or file a new issue.
Comment 31 centurions1195 2013-02-13 13:44:00 UTC
Created attachment 131346 [details]
persian/arabic text problem

netbeans does not show persian/arabic text properly in tags with attributes in html .
Comment 32 coalwater 2013-02-24 12:42:12 UTC
I just downloaded nb7.3 and i was gonna work with a php file that contains lines with arabic, all i see are square characters, when i paste them elsewhere they are readable, but in netbeans they aren't.
Comment 33 Marian Mirilovic 2013-02-26 02:22:27 UTC
This bug was fixed in trunk builds only !

Please download it from :
http://bits.netbeans.org/download/trunk/nightly/latest/
and let us know. We will include the fix into NB 7.3 Patch 1 (scheduled end of March) if we will get confirmation that it works
Comment 34 coalwater 2013-02-26 13:20:46 UTC
I tried the nightly build and i still had it shown as squares, then i thought of changing the font, apparently it was a font issue, so i tried the same thing on the stable 7.3 version and changed it to the same working font and it worked,
I don't know what fix was in that patch but the stable version is working after changing the font, at least for me.
Comment 35 Jiri Prox 2013-03-12 12:14:43 UTC
verified
Comment 36 Miloslav Metelka 2013-03-13 09:58:24 UTC
In release73 (for patch1):
82a545b61c94 transplanted to 7d70d0e82949
Comment 37 Quality Engineering 2013-03-14 21:08:36 UTC
Integrated into 'releases', will be available in build *201303141828* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/7d70d0e82949
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #65158 - I18N - IDE does not handle arabic text properly.
(transplanted from 82a545b61c94d200359ffd2e49137b94bfb2a45d)