bradymiller wrote on Friday, July 31, 2009:
hey,
Just committed some changes to ensure the structure of the database is UTF-8 compliant. The next release of OpenEMR will be 100% UTF-8 compliant to allow special character languages (such as chinese, greek, etc.), however users that are upgrading from a previous version of OpenEMR will continue to have a hybrid UTF-8/latin1 database and thus won’t have 100% UTF-8 compliance. Several ways to go for upgraders (Note these instructions/procedures are only in testing phase, please test them if you can, etc. goal is to have this stuff figured out before the planned 3.1.0 release):
1) If your only using english characters currently and plan on only using English characters in the future, then doing a simple OpenEMR upgrade will suffice.
2) If your only using english characters, However plan to use a language with any special non-english characters in the future, then you should consider converting your database to 100% UTF-8. In this special case (since you were only using english characters previously) then a simple conversion will work. So, you would do the simple OpenEMR upgrade (sql_upgrade.php etc) and then do following two command line commands on your upgraded database (assuming database name is openemr):
-----mysql --database=openemr -B -N -e “SHOW TABLES” | awk ‘{print “ALTER TABLE”, $1, “CONVERT TO CHARACTER SET utf8;”}’ | mysql --database=openemr &
-----mysql -e “ALTER DATABASE openemr CHARACTER SET utf8;”
(NOTE that above will alter your database and could possibly screw it up, so BACK IT UP first)
3) If your currently using non-english characters, and want to continue supporting non-english characters. This is the hard one, because OpenEMR’s previous releases did not do a very good job maintaining consistent encoding in the database (a very common problem in other software also). You could try above strategt in number 2, however you have a possibility of getting garbage. If 2) doesn’t work, then you will likely need to go a strategy like the following linked below:
http://codex.wordpress.org/Converting_Database_Character_Sets
To repeat:
—This only pertains to users that are upgrading (users that are installing 3.1.0 new do not need to worry about this stuff)
—Upgraders that are only planning to use english characters do not need to worry about this stuff. (unless you want to be cool, and say your using OpenEMR with 100% compliance…)