<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">We use Springs ReloadableResourceBundleMessageSource along with a custom message tag. The site is available in german and english and we plan to add turkish and russian in the near future. Property files are encoded in utf-8. We do not encode non ascii characters like - for example - german umlauts. We write "ü" and "ä" and so on<div><br></div><div>Regards</div><div>christoph</div><div><br><div><br></div><div><br><div><br><div><div>Am 30.01.2013 um 08:56 schrieb Ladislav Kulhanek <<a href="mailto:ladislav.kulhanek@gmail.com">ladislav.kulhanek@gmail.com</a>>:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div>Hi,<br><br></div>you should write non ISO-8859-1 characters as \uXXXX. More id detail here: <a href="http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle">http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle</a><br>
<br></div>There are text editors for Eclipse (and I suppose for other IDEs too), which do this automatically.<br><br></div>Cheers,<br></div>Ladislav<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/29 Olli Aro <span dir="ltr"><<a href="mailto:olli_aro@yahoo.co.uk" target="_blank">olli_aro@yahoo.co.uk</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-GB"><div><p class="MsoNormal"><span style="color:#1f497d">Thanks Paul,<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">Yeah, I ended up doing something similar the last time around.<u></u><u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">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?<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">Olli<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a> [mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>] <b>On Behalf Of </b>Paul-Inge Flakstad<br>
<b>Sent:</b> 29 January 2013 15:42<br><b>To:</b> The OpenCms mailing list<br><b>Subject:</b> [Bulk] Re: [opencms-dev] Properties files and UTF-8 characters<u></u><u></u></span></p></div></div><div><div class="h5"><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">Hi Olli,<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d" lang="EN-US">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. <u></u><u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">My solution was: instead of the “normal” CmsJspActionElement.html#label(java.lang.String) method, I used this one:<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">public String labelUnicode(String key) {<u></u><u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d" lang="EN-US"> try {<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"> return new String(this.label(key).getBytes("ISO-8859-1"), "UTF-8");<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"> } catch (java.io.UnsupportedEncodingException e) {<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"> // Really shouldn’t occur<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"> return null;<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"> }<u></u><u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d" lang="EN-US"> }<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">(Above method is part of a convenience class extending CmsJspXmlContentBean.)<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">Not the best solution, but it’s simple and it works.<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">Cheers,<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US">Paul<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a> [<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">mailto:opencms-dev-bounces@opencms.org</a>] <b>On Behalf Of </b>Olli Aro<br>
<b>Sent:</b> 29. januar 2013 16:27<br><b>To:</b> <a href="mailto:opencms-dev@opencms.org" target="_blank">opencms-dev@opencms.org</a><br><b>Subject:</b> [opencms-dev] Properties files and UTF-8 characters<u></u><u></u></span></p>
</div></div><p class="MsoNormal"><span lang="NO-BOK"><u></u> <u></u></span></p><p class="MsoNormal">Hi all,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It has been a while since I last had to deploy OpenCms based on language relying on UTF-8.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">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?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am just thinking maybe I am missing something, since the workplace localisation is also in property files and works fine eg. in German?<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Anyone have any pointers on how to use UTF-8 based property file as part of your site templates?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Olli<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div></div>
</div><br>_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br>
<br>
<br>
<br>
<br></blockquote></div><br></div>
_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br><br><br><br></blockquote></div><br></div></div></div></body></html>