You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose Carlos Rubia Raya <jo...@menta.net> on 2002/07/10 12:15:24 UTC
JDBC charset problem
Hello
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???
Thanks
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re[2]: JDBC charset problem
Posted by Dariusz Wojtas <dw...@myrealbox.com>.
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 :
SetCharacterEncodingFilter
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:
>>Jose,
>>
>>What is your application Server and what Platform are you work with
>>(Solaris/Linux/Windows).
>>
>>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.
>>
>>hth
>>
>>Rajesh
>>
>>-----Original Message-----
>>From: Jose Carlos Rubia Raya [mailto:josecarlosrubiaraya@menta.net]
>>Sent: Wednesday, July 10, 2002 6:15 AM
>>To: struts-user@jakarta.apache.org
>>Subject: JDBC charset problem
>>
>>
>>Hello
>>
>>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???
>>
>>Thanks
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
JCRR> --
JCRR> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
JCRR> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Best regards,
Dariusz Wojtas mailto:dwojtas@myrealbox.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JDBC charset problem
Posted by Jose Carlos Rubia Raya <jo...@menta.net>.
My application Server is Jakarta Tomcat and I 'm working with Linux
Mandrake 8.2.
My DB is PostgreSQL.
Rajesh Kalluri wrote:
>Jose,
>
>What is your application Server and what Platform are you work with
>(Solaris/Linux/Windows).
>
>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.
>
>hth
>
>Rajesh
>
>-----Original Message-----
>From: Jose Carlos Rubia Raya [mailto:josecarlosrubiaraya@menta.net]
>Sent: Wednesday, July 10, 2002 6:15 AM
>To: struts-user@jakarta.apache.org
>Subject: JDBC charset problem
>
>
>Hello
>
>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???
>
>Thanks
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: JDBC charset problem
Posted by Rajesh Kalluri <rk...@manduca.com>.
Jose,
What is your application Server and what Platform are you work with
(Solaris/Linux/Windows).
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.
hth
Rajesh
-----Original Message-----
From: Jose Carlos Rubia Raya [mailto:josecarlosrubiaraya@menta.net]
Sent: Wednesday, July 10, 2002 6:15 AM
To: struts-user@jakarta.apache.org
Subject: JDBC charset problem
Hello
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???
Thanks
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>