This,
खालि नहि रख शकते.
is the HTML-escaped form of Hindi. As part of JSF's builtin XSS-attack prevention, any output text is implicitly HTML-escaped. So, effectively, this HTML-escaped Hindi ends up double-escaped in generated HTML as follows (rightclick, View Source to see it yourself):
खालि नहि रख शकते.
Which causes it to appear in its original HTML-escaped form once interpreted by the webbrowser.
After all, using HTML-escaped form &#XXXX;
in a .properties
file is not the right approach. You should use Unicode-escaped form \uXXXX
instead. See also the javadoc of java.util.Properties
. A bit decent IDE like Eclipse already does it automatically when you edit a file with .properties
extension in a Java-flavored project. You can just type out Hindi in there the usual way and Eclipse will automagically escape it. If you're however using a different editor, or if you can't figure how to configure the editor right, then you'd need to use the JDK-provided native2ascii
tool. Again, see the aforelinked Javadoc for detail.
Ultimately, the proper Unicode-escaped form of your Hindi looks like this (I copypasted after Eclipse escaped it):
\u0916\u093E\u0932\u093F \u0928\u0939\u093F \u0930\u0916 \u0936\u0915\u0924\u0947.
Put this unmodified in your .properties
file.
That it works in legacy JSP is simply because it has as being a rather legacy and inferior view technology no form of implicit XSS attack prevention and therefore doesn't HTML-escape any template text.
Unrelated to the concrete problem, for the case you didn't already knew it, you can also just write Hindi straight in the source code of a Facelets file. You only need to make sure that your editor is configured to use UTF-8 to save text files. The converter you found is absolutely useless for modern JSF development.