Here’s a problem some or most of us have encountered. You have a latin1 table defined like below, and your application is storing utf8 data to the column on a latin1 connection. Obviously, double encoding occurs. Now your development team decided to use utf8 everywhere, but during the process you can only have as little to no downtime while keeping your stored data valid.
CREATE TABLE `t` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `c` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; master> SET NAMES latin1; master> INSERT INTO t (c) VALUES ('¡Celebración!'); …[Read more...]