Re: Java and MySQL character sets
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <OF9791D08D.428DF20D-ON80257171.003C57B9-80257171.003D3602@Research.Quantel> |
Drew Kutcharian <[email protected]> wrote on 17/05/2006 00:01:30: > Hi everyone, > > I am trying to develop an multi-language application that will use > i18n. What is the best character set and collation to use with Java > 5, JDBC and MySQL 5? There are way too many variations, UTF-8, > UTF-16, UCS-2 for character codes, and a lot more collation types! I > checked the Java specs and it says Java supports Unicode 4.0 but how > does this map to MySQL?? I think that any of the variants will "do" for database storage. The main questions are whether the character set supports the collations you need, and the efficiency of storage and comparison. AIUI, UCS-2 cannot store the very rare extended characters above FFFF. However, since it is fixed size, firstly comparisons will probably run faster than with the slightly variable sized UTF-16 and the very variable sized UTF-8, and it can also be used in the slightly more efficient fixed size records. On the other hand, if storage use is important to you, and a large part of your text is in the standard ASCII character set (0-7F), you will get better storage using UTF-8. For my own purposes, I simply put the whole database into UTF-8 mode, and my Japanese users were completely happy. Alec Cawley -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/[email protected]