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

Christian Steinert christian_steinert at web.de
Thu Aug 6 21:31:46 CEST 2009


] 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