How to convert your latin1 mysql table to utf8

Convert the existing columns content if there are unicode characters saved in non utf8 column: UPDATE `databasename`.`prescription_template_billing_item` SET description = @txt WHERE char_length(description) = LENGTH(@txt := CONVERT(BINARY CONVERT(description USING latin1) USING utf8)); Have MYSQL loop through . all of your tables and columns finding all the necessary columns which have types needing to be converted: … Continued

JSON encoding Windows-1252 Unicode chars

While trying to use the json_encode function a Windows-1252 left and right quote character was breaking the encoding and I was ending up with no JSON. The string being encoded was from html within a PHP file. I’m guessing it was copy pasted from a Word doc. To fix this the <a href="http://php.net/manual/en/function.mb-convert-encoding.php">mb_convert_encoding</a> function, not the <a href="http://php.net/manual/en/function.utf8-encode.php">utf8_encode</a> function, was … Continued