Re: JDBC and unicode characters

Martin MC Brown <[email protected]>
Newsgroups gmane.comp.db.mysql.java
Message-ID <[email protected]>
Hi Ian,

>   I'm having problems getting unicode characters from my MySQL  
> database  into my Java program.  I'm using the Connector/J driver  
> and MySQL  5.
> ...
>   I have compiled the Java program with the utf8 character set flag  
> but  this doesn't help.  I don' t think the problem relates to  
> Java  since I can get normal Java programs that don't connect to a  
> database  to output unicode characters without issue.  It's either  
> a MySQL  characterset setting or a Connector/J setting.

Character set encoding is set automatically by Connector/J based on  
the character set encoding of the server (the value of the  
character_set (pre 4.1.0) and character_set_server (4.1.0 and newer).

You can override the automatic determination by using the  
characterEncoding property to the connect string.

There's more information in the manual here: http://dev.mysql.com/doc/ 
refman/5.1/en/connector-j-reference-charsets.html

MC

--
Martin MC Brown, Technical Writer
MySQL AB, http://www.mysql.com
Skype: mcmcslp



-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.