You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Evgeniy Strokin <ev...@yahoo.com> on 2001/08/10 19:24:42 UTC
Encoding problem in Opera browser
I use TC 3.2.3 (Actually in TC 4b7 he same problem)
I have all pages in UTF-8 encoding.
I trying get values from parameters.
I have this code:
String param=_request.getParameter(name);
param=new String(param.getBytes("iso-8859-1"),"UTF-8");
In IE and NS every things fine.
But from Opera I getting value shorter (for example ???? from IE and ?? from
Opera)
and after
param=new String(param.getBytes("iso-8859-1"),"UTF-8");
all not Latin symbols cut.
Please help.
----------------------------------------------------
NetZero Platinum
Sign Up Today - Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97
RE: Encoding problem in Opera browser
Posted by Evgeniy Strokin <ev...@yahoo.com>.
No, I'm not sure.
The Opera display all UTF-8 information correctly.
But seems like it's all time requesting in I don't know which encoding but
not UTF-8 (because value is shorter).
request.getCharacterEncoding() return me null.
request.setCharacterEncoding() doesn't make any influence.
So, I guess we need wait another version of Opera which will be support
Unicode.
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Friday, August 10, 2001 2:52 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Encoding problem in Opera browser
On Fri, 10 Aug 2001, Evgeniy Strokin wrote:
> Still problem.
> In TC4b7 I set request to UTF-8 encoding also (I use
> filters.SetCharacterEncodingFilter
> encoding in web.xml and request.setCharacterEncoding())
> I removed
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> and leaved only
> String param=_request.getParameter(name);
> Exactly the same result: in IE and NS every things fine from Opera value
is
> cut.
>
I don't use Opera, so I don't know if this is a stupid question, but ...
are you sure Opera is really encoding the parameters in UTF-8 like you
expect it to?
Craig
----------------------------------------------------
NetZero Platinum
Sign Up Today - Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97
RE: Encoding problem in Opera browser
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Fri, 10 Aug 2001, Evgeniy Strokin wrote:
> Still problem.
> In TC4b7 I set request to UTF-8 encoding also (I use
> filters.SetCharacterEncodingFilter
> encoding in web.xml and request.setCharacterEncoding())
> I removed
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> and leaved only
> String param=_request.getParameter(name);
> Exactly the same result: in IE and NS every things fine from Opera value is
> cut.
>
I don't use Opera, so I don't know if this is a stupid question, but ...
are you sure Opera is really encoding the parameters in UTF-8 like you
expect it to?
Craig
RE: Encoding problem in Opera browser
Posted by Evgeniy Strokin <ev...@yahoo.com>.
Still problem.
In TC4b7 I set request to UTF-8 encoding also (I use
filters.SetCharacterEncodingFilter
encoding in web.xml and request.setCharacterEncoding())
I removed
param=new String(param.getBytes("iso-8859-1"),"UTF-8");
and leaved only
String param=_request.getParameter(name);
Exactly the same result: in IE and NS every things fine from Opera value is
cut.
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Friday, August 10, 2001 1:31 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Encoding problem in Opera browser
On Fri, 10 Aug 2001, Evgeniy Strokin wrote:
> I use TC 3.2.3 (Actually in TC 4b7 he same problem)
> I have all pages in UTF-8 encoding.
> I trying get values from parameters.
> I have this code:
> String param=_request.getParameter(name);
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> In IE and NS every things fine.
> But from Opera I getting value shorter (for example ???? from IE and ??
from
> Opera)
> and after
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> all not Latin symbols cut.
> Please help.
>
In Servlet 2.3 (and therefore in Tomcat 4b7 but not 3.2.3) there is a new
request.setCharacterEncoding() call that you can use to tell Tomcat to do
this transformation for you before returning the parameter in the first
place.
Craig
----------------------------------------------------
NetZero Platinum
Sign Up Today - Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97
Re: Encoding problem in Opera browser
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Fri, 10 Aug 2001, Evgeniy Strokin wrote:
> I use TC 3.2.3 (Actually in TC 4b7 he same problem)
> I have all pages in UTF-8 encoding.
> I trying get values from parameters.
> I have this code:
> String param=_request.getParameter(name);
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> In IE and NS every things fine.
> But from Opera I getting value shorter (for example ???? from IE and ?? from
> Opera)
> and after
> param=new String(param.getBytes("iso-8859-1"),"UTF-8");
> all not Latin symbols cut.
> Please help.
>
In Servlet 2.3 (and therefore in Tomcat 4b7 but not 3.2.3) there is a new
request.setCharacterEncoding() call that you can use to tell Tomcat to do
this transformation for you before returning the parameter in the first
place.
Craig