users@glassfish.java.net

Re: RE: character encoding

From: <glassfish_at_javadesktop.org>
Date: Tue, 18 May 2010 17:12:16 PDT

Hallo Stijn!!!
From another forum i got this;

It is clearly spelled out in the API docs:

The load and store methods load and store properties in a simple line-oriented format specified below. This format uses the ISO 8859-1 character encoding. Characters that cannot be directly represented in this encoding can be written using Unicode escapes ; only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings.

Wich means that Sun have not changed this in JDK6. So yes i agree with you it is very stupid to have this interpreted as iso-8859-1 by default when these files are meant for internationalization.

From the same forum as above i got this also;

Since 1.5, there is this method though:

/*
Loads all of the properties represented by the XML document on the specified input stream into this properties table.
*/
public void loadFromXML(InputStream in)
                 throws IOException,
                        InvalidPropertiesFormatException

 
If you put files among your classes, then the inputstream will be available as resource from the class loader. If the properties are stored as xml, then you can read them as such.

But i don't really get what he means with this, I'll try to ask him again for more information.

Do you have any other ideas on how i could get this to work for me. Using separate JSP's alltogether is way to much work for me at the moment. Are there no other option with the resource bundles, new what ever to make this work, please let em know???
[Message sent by forum member 'torleif67']

http://forums.java.net/jive/thread.jspa?messageID=470363