tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gatos <ega...@gmail.com>
Subject Re: Char Encoding text streams on Tomcat 5.5 and Linux
Date Fri, 27 Nov 2009 16:12:38 GMT
It might solve your problems:

 <filter>
 <filter-name>charsetFilter</filter-name>
 <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
 <init-param>
 <param-name>encoding</param-name>
 <param-value>ISO-8859-1</param-value>
 </init-param>
 </filter>

 <filter-mapping>
 <filter-name>charsetFilter</filter-name>
 <url-pattern>/*</url-pattern>
 </filter-mapping>


On Fri, Nov 27, 2009 at 6:05 PM, André Warnier <aw@ice-sa.com> wrote:

> Continuing to top-post thus :
>
> If you have some systems working and others not, check if all Tomcat's (or
> rather, their JVMs) start under the same "locale" setting.
> This is not a "good" reason, but it is often a reason for such things.
>
> A bit more detail : in java, if you open a text input stream without
> specifying in which encoding it is, it will default to the "platform"
> encoding, which in this case is the locale setting of the process which runs
> the Java JVM which runs tomcat.
> That applies also to webapps which read posted input, unless you are
> careful.
> You will not see this issue with XML input, because XML contains either an
> explicit charset declaration, or defaults to UTF-8. So the XML parse always
> knows.  But pure text is another matter.
> There is a lot more to say about these matters, but this will get you
> started.
>
>
>
>
> Dan Bagley wrote:
>
>> Hi Peter,
>>
>> Thanks for the heads up, the server build we are having problem with is
>>
>> Server version: Apache Tomcat/5.5.20
>> Server built:   May 8 2007 10:23:38
>> Server number:  5.5.20.0
>> OS Name:        Linux
>> OS Version:     2.6.9-78.0.13.ELsmp
>> Architecture:   amd64
>> JVM Version:    1.5.0_16-b02
>> JVM Vendor:     Sun Microsystems Inc.
>>
>>
>> And yep this is a customer support issue as the later versions of Tomcat
>> have not been approved through there security review process, so they're
>> unable to move onto the later versions.
>>
>> I'll double check Tomcat 5.5.28, but there still may be issues with the
>> client moving onto this release.
>>
>> Cheers
>>
>> Dan
>>
>>
>>
>> Peter Crowther wrote:
>>
>>> 2009/11/27 Dan Bagley <dan.bagley@metadatatechnology.com>:
>>>
>>>
>>>> now when processing the plain text stream the accented characters are
>>>> being
>>>> corrupted even though the stream is being set to UTF-8.   This is only
>>>> happening on Linux and Tomcat 5.5 with plain text,  on windows it works
>>>> and
>>>> Linux using Tomcat 6.0 it works.
>>>>
>>>>
>>>
>>> Dan, exactly which version(s) of 5.5 and 6.0 are you using?  Also,
>>> which JVM are you using on each of these platforms?
>>>
>>> I'm not sure I have a solution for the problem, but you're more likely
>>> to get useful answers off the list if we have some reasonably precise
>>> version information ;-).  If you're not testing on the latest 5.5.x
>>> (which is 5.5.28), I've no doubt you'll also get a "does it still fail
>>> on the latest 5.5?" question.
>>>
>>> From your question, I'm assuming you have a need to support older
>>> Tomcat versions rather than just say "first install Tomcat 6.0.x".  Is
>>> that due to customers having older versions installed, or QA issues,
>>> or some other reasons?
>>>
>>> - Peter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message