You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Milan Křápek <He...@seznam.cz> on 2008/09/30 09:04:18 UTC
Localization encoding
Hi,
I have problem with localization encoding. In my application I use the both ways how to localize it. The first: storing localization in property files wokrs perfect, but the second: defining two HTML files has some problem with encoding.
I use 'cs' encoding for Czech language. The charset of saved file is UTF-8. I added to HTML page the meta element with encoding UTF-8 and my webbrowser views the page in UTF-8 encoding. But some special characters are displayed wrongly.
So the dynamic content of localized pages (from property files) is displayd well but the static part defined in 'mypage_cs.html' is displazyed wrong. Has anybody met the same problem? Is there any methods for configuring waicket to render pages in utf-8 encoding??
Thanks for any response
Milan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Localization encoding
Posted by Sven Meier <sv...@meiers.net>.
For encoding the following is relevant in Wicket:
- <?xml version="1.0" encoding="UTF-8"?>
The explicit encoding of your markup files.
- IMarkupSettings#defaultMarkupEncoding
The default encoding to be used by Wicket to read your markup files
(if not explicitely specified), default null.
- JVM file.encoding
The encoding used by Wicket to read your markup files if neither
above was specified.
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
The encoding of your markup as seen by the browser. This should
match the following...
- IRequestCycleSettings#responseRequestEncoding
The encoding to be used by Wicket to stream markup to the browser,
default UTF-8.
I'd suggest to keep all these the same, e.g. UTF-8. But you could
equally well use different encodings for markup reading and writing. XML
encoding and charset should always match.
As you can see, usually there's no need to mess around with the JVM's
file encoding.
BTW, if you're encoding your markup in UTF-8, you won't have to think
about HTML entities for special characters (e.g. ä) ever again.
Be sure to read:
http://cwiki.apache.org/WICKET/how-to-change-the-character-encoding.html
Sven
Timo Rantalaiho schrieb:
> On Tue, 30 Sep 2008, Milan K?ápek wrote:
>
>> So the dynamic content of localized pages (from property files) is
>> displayd well but the static part defined in 'mypage_cs.html' is
>> displazyed wrong. Has anybody met the same problem? Is there any
>> methods for configuring waicket to render pages in utf-8 encoding??
>>
>
> Have you tried passing -Dfile.encoding=utf-8 to your
> application server? Or checked what is the file.encoding
> system property runtime. Most probably Java gets the default
> value from the operating system (locale -a gives hints in
> Unixes and on Windows I think the encoding is cp1252 which
> is some microsoftied version of ISO-Latin-1).
>
> Best wishes,
> Timo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Localization encoding
Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Tue, 30 Sep 2008, Milan K?ápek wrote:
> So the dynamic content of localized pages (from property files) is
> displayd well but the static part defined in 'mypage_cs.html' is
> displazyed wrong. Has anybody met the same problem? Is there any
> methods for configuring waicket to render pages in utf-8 encoding??
Have you tried passing -Dfile.encoding=utf-8 to your
application server? Or checked what is the file.encoding
system property runtime. Most probably Java gets the default
value from the operating system (locale -a gives hints in
Unixes and on Windows I think the encoding is cp1252 which
is some microsoftied version of ISO-Latin-1).
Best wishes,
Timo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org