[opencms-dev] Properties files and UTF-8 characters
Alexander Kandzior
alex at opencms.org
Thu Jan 31 08:54:15 CET 2013
Olli,
actually the German Umlauts _are_ part of ISO-8859-1 so it’s ok to use them “directly”. That applies for many other special chars in western European languages as well.
It’s just the Euro sign € that is sourly missing from 8859-1, but I guess you British guys don’t care for that anyway :-)
Best regards,
Alex.
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Olli Aro
Sent: Tuesday, January 29, 2013 4:57 PM
To: 'The OpenCms mailing list'
Subject: Re: [opencms-dev] Properties files and UTF-8 characters
Thanks Paul,
Yeah, I ended up doing something similar the last time around.
Just keep wondering how the workplace property files work fine? For example, surely there should be the same issue with the German translation of the workplace?
Olli
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Paul-Inge Flakstad
Sent: 29 January 2013 15:42
To: The OpenCms mailing list
Subject: [Bulk] Re: [opencms-dev] Properties files and UTF-8 characters
Hi Olli,
Can’t say if there have been improvements on this in OpenCms, but I faced the same issue some time ago, working on a site with content in Russian.
My solution was: instead of the “normal” CmsJspActionElement.html#label(java.lang.String) method, I used this one:
public String labelUnicode(String key) {
try {
return new String(this.label(key).getBytes("ISO-8859-1"), "UTF-8");
} catch (java.io.UnsupportedEncodingException e) {
// Really shouldn’t occur
return null;
}
}
(Above method is part of a convenience class extending CmsJspXmlContentBean.)
Not the best solution, but it’s simple and it works.
Cheers,
Paul
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Olli Aro
Sent: 29. januar 2013 16:27
To: opencms-dev at opencms.org
Subject: [opencms-dev] Properties files and UTF-8 characters
Hi all,
It has been a while since I last had to deploy OpenCms based on language relying on UTF-8.
I would like to use the property files as part of my templates, but it still looks as UTF-8 property files are still no no in Java.
Before I write my own version of org.opencms.i18n.CmsPropertyResourceBundle class (like I did last time), I was wondering if there was some other way to get around this?
I am just thinking maybe I am missing something, since the workplace localisation is also in property files and works fine eg. in German?
Anyone have any pointers on how to use UTF-8 based property file as part of your site templates?
Thanks,
Olli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130131/922d03a5/attachment.htm>
More information about the opencms-dev
mailing list