You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Lea <ja...@kumachan.net.nz> on 2003/04/01 00:01:37 UTC
Re: problem with output character encoding using resource bundles
Kornilios Kourtis wrote:
> On Mon, Mar 31, 2003 at 03:55:16PM +0200, Gemes Tibor wrote:
>
>>kkourt-struts@solar.cslab.ece.ntua.gr ?rta:
>>
>>>Also I forgot to write that when I tried the utf-8 encoding for the page
>>>I got some strange symbols (like questionmarks)
>>>in the browser. I thought that it might be the browser's fault and so
>>>I tried to view the page with a couple of browers but none workedd.
> yes I set the encoding of the page (iso-8859-7)
> and I even tried with telnet and verified that the server
> sends question marks
I have managed to get Japanese to work, but using UTF-8. It should mean
I can render a mixture of languages on my page.
I have this at the top of every page:
<%@ page contentType="text/html; charset=UTF-8"%>
I can check that this is being set correctly in the browser with the
following:
Mozilla: Open View->Page Info and look at Encoding
IE: Open View->Encoding
I convert my application.properties file with the following ant task
<native2ascii encoding="UTF-8" src="${project.build.src}"
dest="${project.build.output}">
<include name="**/*.properties"/>
</native2ascii>
This converts the file and puts it into the classes directory.
So I end up with lines like:
login.username=\u30ed\u30b0\u30a4\u30f3
The final part is making sure I use a style sheet that specifies a
Unicode font (eg can display any language). The wrong font will display
as ???.
--
Jason Lea
Email: jason@kumachan.net.nz
Phone/Fax: +64 3 381 2907
Mobile: +64 21 040 2708
Address: 9a Tabart Street, Christchurch, New Zealand
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org