tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Matthews <>
Subject Re: Retrieveing Unicode stuff from MySQL 4.1.x ?
Date Wed, 14 Jul 2004 15:13:58 GMT
Hash: SHA1

Ivan Jouikov wrote:

| I tried using those URL parameters.  Doesn't change anything.
|>-----Original Message-----
|>From: []
|>Sent: Wednesday, July 14, 2004 2:30 AM
|>To: Tomcat Users List
|>Subject: Re: Retrieveing Unicode stuff from MySQL 4.1.x ?
|>Ivan Jouikov wrote:
|>>I tried to use table with CHARACTER SET UTF8, but it didn't change
|>anything :(
|>>Any other suggestions?
|>I'm using a line like the one below to connect to the MySQL DB and it is
|>working quite well here:
|>You may want to specify "characterSetResults" as well.


You're going to have to do a little testing to see _where_ the character
encoding is being lost.

You should first see if the strings that you are inserting into the
database are the same as being retrieved, either in your JSP, or in a
little testcase (I prefer JUnit myself), by using String's .equals()
method and not your 'eyes'.

The reason to do this is to isolate the different stages of
encoding/decoding from each other, because there's an encoding/decoding
between the JDBC driver and the database, there is one yet again between
your JSP and your browser, and there is many times one yet again between
your browser and your operating system.

You will need to check at _each_ stage to make sure that the characters
are encoded the way you think they are.

I can state from experience that _usually_ it's not at the database
level, however, it's usually a mismatch somewhere else that these
problems occur (but they are hard to debug sometimes :( )



- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 332 0507

MySQL Guide to Lower TCO
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird -


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

View raw message