You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "PATTUS, Jean-Philippe" <jp...@sogitec.fr> on 2007/01/23 16:56:38 UTC

How to get UTF-8 decoded parameters from request - Chinese Characters

Hello the list, i'm back with my chinese langage.
In a jsp file i have a <form> <input type="text" id="id"> <button onclick=submit()></button></form>

When i fill my form with chinese characters and i submit() the form,  on the server side when i read the parameter from my request i get  "C:/ç›é€‰ç¨‹åº" something like this.
On the jsp page when i display the query string (document.location.search) i get the correct chinese characters.
How could i set the encoding parameter to Tomcat ? I have tried to add URIEncoding="UTF-8"
in my server.xml but it doesn't work.

If you have some ideas ?
   
 


> Jean-Philippe Pattus 
>  Sogitec Industries
>  Division Documentation et Systèmes
>  E-mail : jppattus@sogitec.fr
>  Tél. : 02.99.05.34.25   Fax : 02.99.05.34.05
>  **** Out of office on wednesday's and friday's afternoons **** 
> 
> 
> 

******************************************************************
Ce message et ses pièces jointes sont confidentiels et établis a l'intention exclusive de ses destinataires.
Tout message électronique est susceptible d'altération. SOGITEC décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié.
Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement.
******************************************************************


Re: How to get UTF-8 decoded parameters from request - Chinese Characters

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jean-Philippe,

PATTUS, Jean-Philippe wrote:
> When i fill my form with chinese characters and i submit() the form,
> on the server side when i read the parameter from my request i get
> "C:/ç›é€‰ç¨‹åº" something like this.

Where do you see this kind of thing?

> On the jsp page when i display the query string
> (document.location.search) i get the correct chinese characters.
> How could i set the encoding parameter to Tomcat ? I have tried to
> add URIEncoding="UTF-8" in my server.xml but it doesn't work.

If the characters re-display correctly in your page after a submit, then
I would say that everything is working correctly.

If you are seeing those funny characters in a log file, then I would
suggest that maybe the tool you are using for viewing your logfile (tail
on UNIX, notepad, whatever) might not understand UTF-8 and/or your
logfile itself is not declared to contain UTF-8 characters.

It might just be a problem with viewing your logs, and it's really
working behind the confusion.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFtjoA9CaO5/Lv0PARAp3eAJ92/JdBxyAPi1+gfx5GtFKGBZh8dwCfcafo
SxS951/JigMt0XnvLBdii3U=
=cbo6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org