igor.vaynberg wrote:
The problem here is specifying the charset, properties factory is global
so
you might encode your files one way but a jar you use with components
might
have them encoded in another charset - so we cannot really have a global
charset specified. i think the proper
Hi everyone!
I've got the following problem.
My component needs to display a cyrillic string. I put it in corresponding
.propreties with encoding cp1251.
But it's read like
Íåïðàâèëüíûé ëîãèí/ïàðîëü
instead of
Неправильный логин/пароль
The problem is that the file is read like iso-8859-1.
You can't. Java property files are always encoded in ISO-8859-1. In
order to use other characters you need to escape them properly. There
is an encoder/decoder for it and/or eclipse plugin.
-Matej
On 7/19/07, wheleph [EMAIL PROTECTED] wrote:
Hi everyone!
I've got the following problem.
My
Or you escape everything as unicode characters (e.g. /u00ef, see
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3), or
you use the xml syntax supported by Java 6 (sorry no idea how that works in
Wicket).
Regards,
Erik.
Matej Knopp-2 wrote:
You can't. Java property
I vaguely remember something about xml properties files that do handle
other encodings. Didn't we implement that? Or was it just one of those
things to do in the next version?
Martijn
On 7/19/07, Matej Knopp [EMAIL PROTECTED] wrote:
You can't. Java property files are always encoded in
Matej Knopp-2 wrote:
You can't. Java property files are always encoded in ISO-8859-1.
I don't think so because actual loading look like this:
properties.load(new BufferedInputStream(resourceStream.getInputStream()));
strings = new ValueMap(properties);
I've solved the problem in the following way:
1. I've created CustomPropertiesFactory subclass of PropertiesFactory and
put it in wicket.resource package (to get access to
wicket.resource.Properties' package-private constructor)
package wicket.resource;
...
public class CustomPropertiesFactory
he problem here is specifying the charset, properties factory is global so
you might encode your files one way but a jar you use with components might
have them encoded in another charset - so we cannot really have a global
charset specified. i think the proper thing to do is use xml properties
On 7/19/07, Martijn Dashorst [EMAIL PROTECTED] wrote:
I vaguely remember something about xml properties files that do handle
other encodings. Didn't we implement that? Or was it just one of those
things to do in the next version?
Yes, that is implemented now. XML properties is a JDK 5 feature,