Java properties UTF-8 encoding in Eclipse
Don't waste your time, you can use Resource Bundle plugin in Eclipse
Old Sourceforge page
Why does Eclipse display UTF-8 encoded files differently?
Look at
Preferences -> General -> Content types -> Java Properties File
The default encoding appears as ISO-8859-1
.
Default encoding can be changed there.
Eclipse .properties file disable escaping of UTF-8 characters
Right Click on the file, properties. Under "resource" tab , check for "Text File Encoding" at the bottom right and change that to UTF-8.
How to make eclipse read bundle properties in UTF-8?
This is not supported. The code that reads the bundle properties file ends up using the PropertyResourceBundle
class which always assumes ISO-8859-1
Java properties files localization & character encoding issue
There are two completely separate issues here:
- Are the properties files saved in the correct encoding? If you edit them inside eclipse, you have to set the text file encoding in the project properties. Note that this setting is saved in the .settings subdirectory of the project.
- Is the correct encoding used to read the properties files? If you read them in your code, be sure to use an
InputStreamReader
to set the encoding. If they're read by some framework, you have to look through its API and configuration to see whether you can specify the encoding.
I suggest avoiding the use of unicode escapes if at all possible.
UTF-8 encoding of application.properties attributes in Spring-Boot
As already mentioned in the comments .properties files are expected to be encoded in ISO 8859-1. One can use unicode escapes to specify other characters. There is also a tool available to do the conversion. This can for instance be used in the automatic build so that you still can use your favorite encoding in the source.
Related Topics
Get the Changed HTML Content After It's Updated by JavaScript? (Htmlunit)
Load Resource from Anywhere in Classpath
Java, "Variable Name" Cannot Be Resolved to a Variable
How to Change the Shape of a Jtabbedpane Tab
Compiler Error When Declaring a Variable Inside If Condition and No Curly Braces
Delete Item from Array and Shrink Array
Java, Simplified Check If Int Array Contains Int
String Comparison and String Interning in Java
Is It Safe to Construct Swing/Awt Widgets Not on the Event Dispatch Thread
Pdfbox 2.0.2 > Calling of Pagedrawer.Processpage Method Caught Exceptions
Bug with Varargs and Overloading
Why Does Arraylist Have "Implements List"