views:

257

answers:

1

I'm attempting to internationalize dcm4chee (a Java based open source medical imaging storage with system) with MySQL, and have a number of questions.

Here's what I know so far 1. I need to change the character set from latin1 to utf8 (to support all the international characters) in the MySQL 2. I'm pretty sure I want to set the collation to utf8_unicode_ci

Here's what I need to know 1. How/when should I do these things? a. Can these changes be made to existing tables? b. If so how do I do it? c. Do these changes need to be made only once for the entire life of the database? d. Will changes made affect only future entries or all entries? 2. How do I change the default for future installs of dcm4chee to use utf8? 3. From my research it appears that changing the character set and collations to use a wide enough character set (utf8) is all I need to do to internationalize MySQL. Is this true? If not, what else do I have to do?

Thanks, any help with this will be greatly appreciated

+1  A: 

I'm no expert, but I've had to change charset/collation on my databases in the past.

  1. a) You can make changes to MySQL tables any time. Back up your database before making changes.

    b) SQL query from Challenges that each developer faces every day:

    ALTER TABLE db_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

    c) Should only need to be changed once. If creating new tables, take care to ensure they are created with the correct charset.

    d) Changes will affect future/existing entries (though if, as a result of the previous charset, older table entries are garbage characters instead of intended UTF8 characters, this change won't magically change them to their intended state).

  2. I'm sorry but I've never used dcm4chee. If the databases are pre-built and bundled with the install, then you will have to change the bundled db. If the db is built when the software is installed, you'll have to locate this section of the source code and alter the "CREATE TABLE..." SQL query so that it creates the tables with the appropriate charset. Might be a good idea to search for "CREATE TABLE" within each source file, to be certain none get missed.

  3. In my limited MySQL experience, changing the charset/collation is sufficient to internationalize a db. I have only had experience with Chinese+English databases, though in each case I encountered no problems after changing charset/collation.