(WARNING: this is my first java application, coming from .NET, so don’t bash me if I write too much garbage)
I’m developing a simple JSF 1.2 web application which should support Russian, Chinese, and other languages outside ISO 8859-1, which is automatically used in Properties.load().
Is there a way to use the Properties loaded from XML files, with Properties.loadFromXml(), inside JSF, without writing too much code?
I know there are alternative ways to do so (writing my own loader, escaping the characters…), but I’d really love to find a simple solution, and I don’t see it in all the forums I checked.
Thanks in advance for any help
I think the most widely used approach is to encode your
.propertiesfiles with unicode escape sequences. This can easily be done with the AnyEdit plugin for Eclipse.The problem is that
ResourceBundleuses theProperties(inputStream)constructor, rather thanProperties(reader).You can use your own
LoadBundlecomponent instead off:loadBundleto overcome this, but you’ll have to:ResourceBundleimplementationnew InputStreamReader(classloader.getResourceAsStream(..))