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 32392 - I18N - Edit Text Rather than Escape Sequences
Summary: I18N - Edit Text Rather than Escape Sequences
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Marian Petras
URL:
Keywords: I18N, UI
: 35160 50757 (view as bug list)
Depends on:
Blocks: 32123 89720
  Show dependency tree
 
Reported: 2003-03-27 12:33 UTC by _ pkuzel
Modified: 2007-04-18 16:27 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
The picture (2.12 KB, image/png)
2003-03-27 12:35 UTC, _ pkuzel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2003-03-27 12:33:33 UTC
Currently properties files have assigned text
editor that let user edit escape sequences. It
means that user must write all non-ASCII text
using unicode escapes instead of typing it
directly on keyboard.

If he does not escape then he produces invalid
file without any feedback.

I propose to edit text at character level hiding
whole escaping logic. See attached picture. Upper
line is current state lower line is proposed state.
Comment 1 _ pkuzel 2003-03-27 12:35:15 UTC
Created attachment 9560 [details]
The picture
Comment 2 Jesse Glick 2004-10-07 01:01:17 UTC
*** Issue 35160 has been marked as a duplicate of this issue. ***
Comment 3 Marian Petras 2005-05-03 14:52:13 UTC
This is a reasonable enhancement, indeed.
Comment 4 Jesse Glick 2006-01-02 21:48:18 UTC
*** Issue 50757 has been marked as a duplicate of this issue. ***
Comment 5 gborkowski 2006-01-23 10:54:39 UTC
My proposal to this issue: 
Let's leave all those native encodings and stick to UTF-8 finally. All
.properties files in the src/ directory should be in UTF-8, and editor reads and
writes them in this formatm, whithout any escaping. Easy and powerful.
Then we add new ANT task which during copying those files from src/ to build/
will change the format from UTF-8 to all those \uxxxx needed by JVM.

Obviously, this won't work for configuration files used by NetBeans projects.
But those files CAN - I hope - and SHOULD be stored in UTF-8.
Comment 6 kovica 2006-04-26 13:46:51 UTC
Since Mustang B81 has fixed this
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6204853) will NetBeans 6.0
provide this funtionality, so that properties files will be saved in UTF-8?
Comment 7 Ken Frank 2006-05-04 18:03:27 UTC
Can team look at fixing this for next nb, and since as mentioned below
the newer jdk has fixed it ? 

ken.frank@sun.com
Comment 8 sir_no 2006-10-04 11:19:15 UTC
If the .properties files were opened by default in ResourceBundle editor
(via "Open" command) instead of text editor ("Edit" command - the default one),
I think that the whole problem would become less relevant.

The ResourceBundle editor already does the required translation (similar to what
native2ascii does) so editing .properties files manually is not no more necessary
to get the right encoding. You still must remember about users using JDK 1.4/1.5,
so they wouldn't be unnecesarily surprised.

This change is already proposed in issue #71885.
Comment 9 gborkowski 2006-10-04 13:30:57 UTC
The problem is that sometimes I need to edit those files manually, even in the
simplest editor like Notepad. Then I got bunch of /uxxxx's and it is illegible.
Suppose I want to send such file to smb to translate it - now it is difficult.
If files in "src" directory were in UTF-8, it would be no problem.
I'm not sure about Java 6, if it can read UTF-8 properties then for source 1.6
we could just copy those files, and for source <1.6 we copy them and call
nativeToAscii tool in build directory.
Comment 10 Jesse Glick 2006-12-10 20:24:38 UTC
See also issue #75906 and issue #90863.
Comment 11 Marian Petras 2007-04-18 16:25:59 UTC
Implementation and use of the specific encoding for .properties files (issue
#98761) resolved also this issue.

Modified files:
   ide/golden/deps.txt   (1.543)
   properties/manifest.mf   (1.69)
   properties/nbproject/project.xml   (1.12)
   properties/src/org/netbeans/modules/properties/:
                                       Bundle.properties   (1.76)
                                       PropertiesDataLoader.java   (1.29)
                                       PropertiesDataObject.java   (1.55)
                                       PropertiesEditorSupport.java   (1.88)
                                       PropertiesEncoding.java   (1.1 - new)
properties/test/unit/src/org/netbeans/modules/properties/:
                                       PropertiesEncodingTest.java   (1.1 - new)

Diffs:
http://ide.netbeans.org/source/browse/ide/golden/deps.txt?r1=1.542&r2=1.543&diff_format=u
http://properties.netbeans.org/source/browse/properties/manifest.mf?r1=1.68&r2=1.69&diff_format=u
http://properties.netbeans.org/source/browse/properties/nbproject/project.xml?r1=1.11&r2=1.12&diff_format=u
http://properties.netbeans.org/source/browse/properties/src/org/netbeans/modules/properties/Bundle.properties?r1=1.75&r2=1.76&diff_format=u
http://properties.netbeans.org/source/browse/properties/src/org/netbeans/modules/properties/PropertiesDataLoader.java?r1=1.28&r2=1.29&diff_format=u
http://properties.netbeans.org/source/browse/properties/src/org/netbeans/modules/properties/PropertiesDataObject.java?r1=1.54&r2=1.55&diff_format=u
http://properties.netbeans.org/source/browse/properties/src/org/netbeans/modules/properties/PropertiesEditorSupport.java?r1=1.87&r2=1.88&diff_format=u
http://properties.netbeans.org/source/browse/properties/src/org/netbeans/modules/properties/PropertiesEncoding.java?rev=1.1&content-type=text/vnd.viewcvs-markup
http://properties.netbeans.org/source/browse/properties/test/unit/src/org/netbeans/modules/properties/PropertiesEncodingTest.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Comment 12 Marian Petras 2007-04-18 16:27:47 UTC
Correction:
The issue the fix of which resolved this issue, was issue 97861 (not 98761).