struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dariusz Wojtas <>
Subject Re[2]: JDBC charset problem
Date Wed, 10 Jul 2002 15:12:46 GMT
Hi Jose,

I had similar problem with Tomcat, MySQL and ISO-8859-2 encoding.
I had to do 2 things to solve that problem:
 1) set correct database encoding (MySQL doesn't support UTF yet)
    That was easy to find.

 2) correctly decode characters sent by the browser
    The problem is that most browsers encode characters using
    encoding that you specify in the page (for example using META
    tag), but they do not send info what encoding was used
    when sending that encoded data to the server.
    If that information is not provided - server uses default
    encoding, which is ISO-8859-1.
    And at this point your struts forms may contain messed data.

    To give the server some hint what encoding to use - try to use
    filters. Look at :
    that comes with Tomcat examples (examples/web-inf/classes/filters)
    Very easy to use or extend to your needs.
    It only checks if characterEncoding was set, and if not - it sets
    the default encoding specified in the configuration.

    That solved my problem.

Dariusz Wojtas

Wednesday, July 10, 2002, 6:00:21 PM, you wrote:
JCRR> My application Server is Jakarta Tomcat and I 'm working with Linux 
JCRR> Mandrake 8.2.
JCRR> My DB is PostgreSQL.

JCRR> Rajesh Kalluri wrote:

>>What is your application Server and what Platform are you work with
>>Its most probably not setting up correctly with NLS_LANG settings in the
>>profile of the user you web server/app server is running as.
>>Also if you are running Oracle as ur db make sure you have nls_charset12.jar
>>in your webserver classpath.
>>-----Original Message-----
>>From: Jose Carlos Rubia Raya []
>>Sent: Wednesday, July 10, 2002 6:15 AM
>>Subject: JDBC charset problem
>>I have a little program.
>>In some forms I introduce words like "d'enginyeria en informàtica" and I
>>store this words in my DB.
>>After, when I retrieve this words from the DB to show them in a form the
>>words appear like "d?enginyeria en inform?tica".
>>How can I configure my JDBC to resolve this problem???
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
>>To unsubscribe, e-mail:   <>
>>For additional commands, e-mail: <>

JCRR> --
JCRR> To unsubscribe, e-mail:   <>
JCRR> For additional commands, e-mail: <>

Best regards,
 Dariusz Wojtas       

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

View raw message