tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <>
Subject Re: Euro symbol
Date Tue, 03 Apr 2007 13:20:08 GMT
most probably one of those is happening

1) IE sends form in iso-8859-1 and tomcat decodes it in UTF-8, resulting
in wrong character
2) IE sends form in UTF-8 and tomcat decodes it in ISO-8859-1

Be aware that the charset of current page is not always used by browser
as the charset used to encode parameters when submitting form. One
possible way i know to prevent such problem is
1) set page encoding to utf-8
2) in the <form> tag add an acceptCharset="UTF-8" parameter
3) call request.setCharacterEncoding("UTF-8") before getting your first

En l'instant précis du 03/04/07 14:33, Tremal Naik s'exprimait en ces
> Hello,
> I have problems with the encoding of the euro symbol.
> I set the charset to UTF-8 in my page:
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> I submit a form containing the euro symbol in a client account number
> text field (typed in Internet Explorer in a Windows environment).
> I set a breakpoint on
> org.apache.coyote.http11.Http11Processor.process() and check in the
> eclipse debugger the org.apache.coyote.Request object which is passed
> as an argument in the adapter.service(request, response) call:
> encoding="ISO-8859-1"
> content-type="application/x-www-form-urlencoded"
> and the following is the result of some expressions:
> request.getParameters().getParameter("accountNo") prints an
> unprintable char
> URLEncoder.encode(request.getParameters().getParameter("accountNo"),"UTF-8")="%C2%80"
> That is not what I expect, since the UTF-8 encoding for the EURO sign
> should be %E2%82%AC (correct me if I'm wrong)
> This causes some trouble since I'll save the client account number
> with a different encoding then expected.
> Can you clarify this to me please?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message