Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: utf 8 on language translations
Hi, when i add custom language key the data is displaying irrelevent
eg : Sélectionner une langue <--- expected
But it is displaying as s�lectionnez une langue
any idea what should be done here?
eg : Sélectionner une langue <--- expected
But it is displaying as s�lectionnez une langue
any idea what should be done here?
Contrary to other properties-files encodings, Liferay's translation properties files need to be UTF-8 encoded
can you give me an example regarding this i am not quite understand where i should encode whether add some properties in hook? or convert the text to utf-8 text like /u2019 instead of '
You can easily create a text file with utf-8 encoding and then change its extension to *.properties
in my properties file it is displaying as utf8 encoded string
Sélectionner une langue <--- in my properties file
also in my hook i have used utf8 encode
@Component( property = { "language.id=fr_FR" }, service = ResourceBundle.class)
public class FrenchHook extends ResourceBundle { ResourceBundle bundle = ResourceBundle.getBundle("content.Language", UTF8Control.INSTANCE); @Override
protected Object handleGetObject(String key) {
return bundle.getObject(key);
}
and in my tomcat setenv.sh i have set utf8 encoding
and in the system properties inside the portel it is utf-8 encoding.
but in the application when a user views it it is displaying as s�lectionnez une langue
this is my problem
Sélectionner une langue <--- in my properties file
also in my hook i have used utf8 encode
@Component( property = { "language.id=fr_FR" }, service = ResourceBundle.class)
public class FrenchHook extends ResourceBundle { ResourceBundle bundle = ResourceBundle.getBundle("content.Language", UTF8Control.INSTANCE); @Override
protected Object handleGetObject(String key) {
return bundle.getObject(key);
}
and in my tomcat setenv.sh i have set utf8 encoding
and in the system properties inside the portel it is utf-8 encoding.
but in the application when a user views it it is displaying as s�lectionnez une langue
this is my problem

Christoph Rabel, modified 5 Years ago.
RE: utf 8 on language translations
(Answer)
Liferay Legend
Posts: 1555
Join Date: 9/24/09
Recent Posts
That you see the content in the file correctly does not mean that it is actually UTF-8 encoded. You need to check if the properties file is actually UTF-8 encoded.
Are you using Eclipse?
If so, right click the resource file and click "Properties". It will show you the encoding of the file. Is it actually UTF-8?
Note: There are some other editors that can help too, I think, Notepad++ also detects the file encoding correctly.
Are you using Eclipse?
If so, right click the resource file and click "Properties". It will show you the encoding of the file. Is it actually UTF-8?
Note: There are some other editors that can help too, I think, Notepad++ also detects the file encoding correctly.
That resolved the issue ty
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™