Skip to main content
added 268 characters in body
Source Link
Twaldigas
  • 1.7k
  • 15
  • 22

.properties files in Java use always ISO-8859-1. You are not able to save UTF-8 characters into .properties files. You must save the characters as unicode escape characters.

In your example the value of the key must look like this:

Seulement Alphabets, des chiffres et des espaces sont autoris\u00E9s

Take a look here: http://www.fileformat.info/info/unicode/char/e9/index.htm

With this solution you do not need any convert of the character set in your Java code. Just read the content of your .properties file.

There exist also some nice Eclipse plugins to edit .properties files who automatically convert text into the right format.

.properties files in Java use always ISO-8859-1. You are not able to save UTF-8 characters into .properties files. You must save the characters as unicode escape characters.

In your example the value of the key must look like this:

Seulement Alphabets, des chiffres et des espaces sont autoris\u00E9s

Take a look here: http://www.fileformat.info/info/unicode/char/e9/index.htm

.properties files in Java use always ISO-8859-1. You are not able to save UTF-8 characters into .properties files. You must save the characters as unicode escape characters.

In your example the value of the key must look like this:

Seulement Alphabets, des chiffres et des espaces sont autoris\u00E9s

Take a look here: http://www.fileformat.info/info/unicode/char/e9/index.htm

With this solution you do not need any convert of the character set in your Java code. Just read the content of your .properties file.

There exist also some nice Eclipse plugins to edit .properties files who automatically convert text into the right format.

Source Link
Twaldigas
  • 1.7k
  • 15
  • 22

.properties files in Java use always ISO-8859-1. You are not able to save UTF-8 characters into .properties files. You must save the characters as unicode escape characters.

In your example the value of the key must look like this:

Seulement Alphabets, des chiffres et des espaces sont autoris\u00E9s

Take a look here: http://www.fileformat.info/info/unicode/char/e9/index.htm