2 messages in com.mysql.lists.javaRe: Character Encoding Question.
FromSent OnAttachments
Tye, Timothy27 Feb 2002 09:19 
Mark Robson27 Feb 2002 12:25 
Subject:Re: Character Encoding Question.
From:Mark Robson (slar@ntlworld.com)
Date:02/27/2002 12:25:14 PM
List:com.mysql.lists.java

Java uses Unicode characters internally.

Yes, it does. Its internal string format is loosely based on UTF-8

How are Java characters stored in MySQL data bases?

In the same way as characters from non-Java applications.

MySQL supports a variety of 8-bit encodings, but as far as I know it does not support UTF-8 or other unicode enodings.

This is of course transparent to a Java application until you try to put in a character which doesn't exist in the encoding MySQL is using, which I rather suspect would raise an exception.

Has anyone used UTF-8 encoding in MySQL tables?

As far as I'm aware, UTF-8 isn't supported in the current version of MySQL (Whatever that is). If there is support for it, it is currently undocumented

:)

I expect this will be on MySQL's list of things to do in future releases.

In the mean time, choose an 8 bit or multibyte non-unicode encoding which contains the characters you intend to store.

As a last resort you could stick UTF-8 strings in BLOBs, but I wouldn't recommend it as it would severely limit the ability to use that collumn in a WHERE clause.

Regards Mark

-------------------------------------------------------