Community
Participate
Working Groups
Java 1.6 supports loading properties file with different encodings than ISO-8859-1. (see ResourceBundle.getBundle(...) methods which take a parameter of type ResourceBundle.Control) Eclipse nls tooling should also support different encodings - Externalize wizard - This will use unicode escapes even if not needed - Hovers showing NLSed strings - Find Broken Externalized Strings ? For eclipse style NLS, org.eclipse.osgi.util.NLS will also have to support to load .properties file with different encoding other than ISO-8859-1
> For eclipse style NLS, org.eclipse.osgi.util.NLS will also have to support to > load .properties file with different encoding other than ISO-8859-1 That would be quite difficult to implement: 1. org.eclipse.osgi is restricted to OSGi/Minimum-1.2 (which is 1.4-based), so Properties#load(Reader) could only be called via a reflection hack. 2. The encoding of a *.properties file is only known in the workspace. This information would somehow need to flow into the NLS class at run time (when the workspace is not available). This could theoretically be solved with a string that is passed to NLS.initializeMessages(..), but this somehow needs be synchronized with the encoding of the *.properties file in the workspace.
(In reply to comment #1) > > For eclipse style NLS, org.eclipse.osgi.util.NLS will also have to support to > > load .properties file with different encoding other than ISO-8859-1 > > That would be quite difficult to implement: > > 1. org.eclipse.osgi is restricted to OSGi/Minimum-1.2 (which is 1.4-based), Not really: The NLS class can offer a load(...) method so that reading (or even Properties creation) is delegated. > 2. The encoding of a *.properties file is only known in the workspace. This > workspace is not available). This could theoretically be solved with a string > that is passed to NLS.initializeMessages(..), Right. Our message class already has meta information that points to the properties file (BUNDLE_NAME). We could just add the encoding info as well and have the 'Find Broken NLS Strings' action detect incompatibilities.