tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jilles van Gurp <>
Subject Re: Problems with utf-8 encoding - continue
Date Mon, 19 Sep 2005 06:51:42 GMT
Why aren't you using setContentType("text/html, "utf-8") on the response?

What content-type is the server actually returning (use the live http 
headers extension for firefox or something similar to find out).

What database and jdbc driver are you using? What method are you using 
to store the string in the database?

I've had utf-8 trouble with several databases. For example mysql 4.1 + 
the latest jdbc driver + setCharacterStream had some strange effects. 
First of all you need to tell mysql to use utf-8 (it defaults to 
something else) and even if you do that setCharacterStream has some 
issues that go away if you use setString. Oracle on the other hand 
cannot insert strings larger than 4KB with setString so you need to use 
setCharacterStream. Incidently, the mysql driver implementation of 
setCharacterString is implemented using setString!



Yair Zohar wrote:
> sorry for the double mail,
> I forgot to add my server.xml encoding definitions:
> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>               port="8080" URIEncoding="UTF-8" 
> useBodyEncodingForURI="true"
>           minProcessors="5" maxProcessors="75"
>               enableLookups="true" redirectPort="8443"
>               acceptCount="100" debug="0" connectionTimeout="20000"
>               useURIValidationHack="false" 
> disableUploadTimeout="true"  />
> I tried it with and without the useBodyEncodingForURI="true"directive.
> Yair.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message