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]
*** 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 ?
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.
PropertiesEncoding.java (1.1 - new)
PropertiesEncodingTest.java (1.1 - new)
The issue the fix of which resolved this issue, was issue 97861 (not 98761).