[opencms-dev] Problems with Umlaute in workplace.properties files (OpenCms 7.5)

] Code Create [ Bernd Wolfsegger bw at code-create.com
Thu Aug 6 23:30:44 CEST 2009


Uh-oh, thanx a lot for reminding ... as I just migrated my whole system which
was ISO-8859-1 based this problem never occurred before :)
By the way ISO-8859-1 is 8 bit.

What a nuisance ...

It seems the Java 6 Properties class supports UTF-8 via loadFromXML(...) or
load(Reader), but unfortunately PropertyResourceBundle does not ... :(

Kind regards, Bernd

-----Ursprüngliche Nachricht-----
Von: christian_steinert at web.de [mailto:christian_steinert at web.de] 
Gesendet: Donnerstag, 6. August 2009 21:32
An: bw at code-create.com; The OpenCms mailing list
Betreff: Re: [opencms-dev] Problems with Umlaute in workplace.properties files
(OpenCms 7.5)

] Code Create [ Bernd Wolfsegger wrote:
> Hi all, hi Alkacon,
>
> I encountered problems with Umlaute in workplace.properties files.
> My whole environment (SuSE 11.0, OpenCms 7.5, MySql 5..., Tomcat 6..., Java 6)
> is UTF-8 based.
> Nevertheless, when I use Umlaute for label definition values in a
> workplace.properties file, as for example in Überschrift, these will be
rendered
> as strange characters in the labels when editing a file with such an
Überschrift
> label in the workplace. (Well, that was a long sentence ...)
> Umlaute are displayed correctly when I edit the workplace.properties itself.
> Also Umlaute in the content are displayed correctly when rendered.
>
> Any hints or ideas what I'm doing wrong, or is it a bug?
>   
If I am not mistaken, then this is a "feature" of Java in general.

Opencms uses standard Java property files. Property files do ONLY allow 
to enter 7bit ascii directly. Everything else must be represented as 
unicode escape sequences in the form \u1234 - see for example 
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html

So - you need to encode . I don't know why Sun never extended the spec 
for non xml-based property files to allow direct unicode usage, but 
that's the way it is, so you need to properly convert your file with the 
native2ascii tool.

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html

hth
Christian




More information about the opencms-dev mailing list