Quoting Andoni <[EMAIL PROTECTED]>:

> Hello,
> 
> I have recently completed the torturous process of translating my web-site
> into 16 European languages.  Having had lots of advice from this list and
> other sources I have come down to a few conclusions about what a Java /
> Tomcat web-site needs in order to fully support UTF-8.
> 
> These are:
> 
> 1.
> JSP pages must inlcude the header:
> 
> <%@ page
>  contentType="text/html; charset=UTF-8"
> %>

This is if you use JSP.  If you work with servlets, then you should output the
appropriate headers.

> 2.
> In the Catalina.bat (windows) catalina.sh (windows) apache$jakarta_config.com
> (OpenVMS), file there must be a switch added to the call to java.exe.  The
> switch is:
> 
> -Dfile.encoding=UTF-8
> 
> I cannot find documentation for this environment variable anywhere or what it
> actually does but it is essential.

It's not Tomcat-specific, tt should be probably somewhere in Java specifications.

> 3.
> For translation of inputs coming back from the browser there must be a method
> that translates from the browser's ISO-8859-1 to UTF-8.  It seems to me that
> -1 is used in all regions as I have had people in countries such as Greece &
> Bulgaria test this and they always send input back in -1 encoding.  The
> method which you will use constantly should go something like this:

I wonder why you need this.  I have no need to convert anything into UTF-8 by
hand - Tomcat does it for me (and I work not only with European languages).  My
code includes the following line:

req.setCharacterEncoding("UTF-8");

and everything works OK with IE and Mozilla.

Regards,

Andre.


-- 
=============================================================
Andre E. Bar'yudin
Home page:  http://www.cs.huji.ac.il/~baryudin/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to