Problems with unicode
Posted by: Brian McAnulty
Date: May 18, 2005 09:17AM


I'm having problems getting the unicode support to work, JDK 1.4.2_06, Connector/J 3.18, MySQL 4.1.10 on Win2K.

Basically, I need to store unicode characters in a table that exists in a non unicode database, ie: the default database set is 'latin1'.

I can't change the default database set as I need the ability to pull other MyISAM tables into this database now and then, and you can't do this if the current DB is 'utf8' and the DB you're pulling the .myd/.myi/.frm files are older (in this case 3.23.38 MyISAM tables). MySQL does a neat trick here and reduces the width of text columns to a 3rd of their original width. Useful.

(If I set the default character set to 'utf8' everything works fine - I just can't!)

So...I need to leave the default character set as latin1 on the server.

I've tried a combination of the following JDBC connection params:


And none of these seem to do the trick.

Well, I say "they don't seem to do the trick" but perhaps they are - its quite difficult to tell. If I use a MySQL client (DOS) and just do the usual SELECT x FROM mytable I get ?????? even though my my.cnf file has the 'default-character-set=utf8' in the client section (not in the mysqld section). So, I would assume that the characters aren't being stored as unicode - correct?

I noticed, stepping through the code, that there is another param (I couldn't find documentation on this) - useOldUTF8Behavior.

So, anyone got any ideas? It can't be that difficult, surely?!


Options: ReplyQuote

Written By
Problems with unicode
May 18, 2005 09:17AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.