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 155934

Summary: Allow loading/saving of UTF-8 encoded property files
Product: utilities Reporter: akochnev <akochnev>
Component: PropertiesAssignee: issues@utilities <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: jglick
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description akochnev 2008-12-22 13:32:54 UTC
Currently (per property file specification) property files are loaded and stored in ISO-8859-1 encoding (disregarding
the encoding specified for the project. As a result, editing a UTF-8 property file (and saving it as such) becomes
unnecessarily difficult: I  have to rename the file to .txt, edit it as a text file, edit it, save it and then rename it
back to .properties file . THe alternative is to use another editor (e.g. vi) to edit this property file. 

There seem to be well known workarounds for this issue (e.g.
http://dirk.net/2008/12/11/utf-8-encoding-in-netbeans-editor-on-linux/ ,
http://ditoinfo.wordpress.com/2007/02/26/netbeans-and-utf8-encoding-2/), but they don't seem to apply to property files. 

The specific use case for this is that I was trying to contribute a localization patch to Tapestry 5, which incidentally
uses UTF-8 encoded property files.
Comment 1 Jesse Glick 2010-07-07 18:08:25 UTC
ISO-8859-1 is the standard encoding for properties files since the beginning of Java; other characters must be escaped. There is an open RFE to detect other encodings, but it cannot be reliable since the file itself does not specify its encoding.

*** This bug has been marked as a duplicate of bug 75906 ***
Comment 2 akochnev 2010-07-07 22:09:14 UTC
I guess the idea here was not to change the default encoding for property files - as you mention, by the default encoding is already specified. 

The idea here is to be able to change the encoding, if for whatever reason, I needed a property file saved in an encoding that's not the default.