UTF8 encoding
In MySql, if you store utf8 encoded data in a latin1 charset, you end up with double encoded utf8 output when querying against the DB with charset set to utf8, having it set to latin1 would resolve the issue, but this will cause issues for newly inserted data.
The solution is to reverse the double encoding by converting the affected columns character sets from latin to binary and then back to utf8.
Example:
ALTER TABLE `MyTable` Modify `Title` text CHARACTER SET latin1;
ALTER TABLE `MyTable` Modify `Title` text CHARACTER SET binary;
ALTER TABLE `MyTable` Modify `Title` text CHARACTER SET utf8;
Written by Mike Wu
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#