You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Niu Kun <ha...@gmail.com> on 2007/07/01 16:16:32 UTC

Problem about posting Chinese characters to tomcat server.

Dear all,

I've just got a simple form to post Chinese characters to my jsp file.
But the data submitted can't be seen on my web browser.
After analyzing the data posted and shown on my browser, I find the
following problem.

The letters I submit are "e7 89 9b e5 9d a4" which are in UTF-8 form.
And the letters catched on the return webpage are
"c3 a7 c2 89 c2 9b c3 a5 c2 9d c2 a4".
We can see that each single character is doubled.
Each one is first prefixed with "c3" and then two "c2".
It's true that I add URIEncoding="UTF-8" to my connector's parameter list.
And all my files are encoded as "UTF-8" format.

My tomcat version is 5.5.
My jdk is 1.5.
And my os is Debian lenny.

Any help would be appreciated and thanks in advance.

Regards


---------------------------------------------------------------------
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


Re: Problem about posting Chinese characters to tomcat server.

Posted by Kun Niu <ha...@gmail.com>.
Thank you for your excellent link.
But what makes me feel strange is that how can I add the code
String paramEncoding = application.getInitParameter("PARAMETER_ENCODING");
request.setCharacterEncoding(paramEncoding);
into my JSP file.
And now to my JSP file, I turn to the fmt namespace.
I added <fmt:requestEncoding value="UTF-8" /> to my JSP webpage.
And it finally works for me. :)
Thanks again.

2007/7/2, Johnny Kewl <jo...@kewlstuff.co.za>:
> Best article I have found so far on this subject, is this one....
> It seems that POST is more difficult than GET....
> http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/
>
> good luck...
>
> ----- Original Message -----
> From: "Niu Kun" <ha...@gmail.com>
> To: <us...@tomcat.apache.org>
> Sent: Sunday, July 01, 2007 4:16 PM
> Subject: Problem about posting Chinese characters to tomcat server.
>
>
> > Dear all,
> >
> > I've just got a simple form to post Chinese characters to my jsp file.
> > But the data submitted can't be seen on my web browser.
> > After analyzing the data posted and shown on my browser, I find the
> > following problem.
> >
> > The letters I submit are "e7 89 9b e5 9d a4" which are in UTF-8 form.
> > And the letters catched on the return webpage are
> > "c3 a7 c2 89 c2 9b c3 a5 c2 9d c2 a4".
> > We can see that each single character is doubled.
> > Each one is first prefixed with "c3" and then two "c2".
> > It's true that I add URIEncoding="UTF-8" to my connector's parameter list.
> > And all my files are encoded as "UTF-8" format.
> >
> > My tomcat version is 5.5.
> > My jdk is 1.5.
> > And my os is Debian lenny.
> >
> > Any help would be appreciated and thanks in advance.
> >
> > Regards
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
失业
         牛坤
MSN:haoniukun@hotmail.com

Re: Problem about posting Chinese characters to tomcat server.

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Best article I have found so far on this subject, is this one....
It seems that POST is more difficult than GET.... 
http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/

good luck...

----- Original Message ----- 
From: "Niu Kun" <ha...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Sunday, July 01, 2007 4:16 PM
Subject: Problem about posting Chinese characters to tomcat server.


> Dear all,
>
> I've just got a simple form to post Chinese characters to my jsp file.
> But the data submitted can't be seen on my web browser.
> After analyzing the data posted and shown on my browser, I find the
> following problem.
>
> The letters I submit are "e7 89 9b e5 9d a4" which are in UTF-8 form.
> And the letters catched on the return webpage are
> "c3 a7 c2 89 c2 9b c3 a5 c2 9d c2 a4".
> We can see that each single character is doubled.
> Each one is first prefixed with "c3" and then two "c2".
> It's true that I add URIEncoding="UTF-8" to my connector's parameter list.
> And all my files are encoded as "UTF-8" format.
>
> My tomcat version is 5.5.
> My jdk is 1.5.
> And my os is Debian lenny.
>
> Any help would be appreciated and thanks in advance.
>
> Regards
>
>
> ---------------------------------------------------------------------
> 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
>
> 


---------------------------------------------------------------------
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


Re: Problem about posting Chinese characters to tomcat server.

Posted by Kun Niu <ha...@gmail.com>.
It seems that get and post are treated differently.
But thank you all the same.:)

2007/7/2, Mark Thomas <ma...@apache.org>:
> Niu Kun wrote:
> > Any help would be appreciated and thanks in advance.
>
> http://tomcat.apache.org/faq/misc.html#tomcat5CharEncoding
>
> Mark
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
失业
         牛坤
MSN:haoniukun@hotmail.com

Re: Problem about posting Chinese characters to tomcat server.

Posted by Mark Thomas <ma...@apache.org>.
Niu Kun wrote:
> Any help would be appreciated and thanks in advance.

http://tomcat.apache.org/faq/misc.html#tomcat5CharEncoding

Mark


---------------------------------------------------------------------
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