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.
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.
Created attachment 9560 [details] The picture
*** Issue 35160 has been marked as a duplicate of this issue. ***
This is a reasonable enhancement, indeed.
*** Issue 50757 has been marked as a duplicate of this issue. ***
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.
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?
Can team look at fixing this for next nb, and since as mentioned below the newer jdk has fixed it ? ken.frank@sun.com
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.
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.
See also issue #75906 and issue #90863.
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
Correction: The issue the fix of which resolved this issue, was issue 97861 (not 98761).