This shows you the differences between two versions of the page.
|
backend-tech:going-utf-8-utf8-with-php-and-mysql [Apr 6, 2010 03:49 PM] dordal |
backend-tech:going-utf-8-utf8-with-php-and-mysql [Apr 6, 2010 03:50 PM] (current) dordal |
||
|---|---|---|---|
| Line 93: | Line 93: | ||
| </code> | </code> | ||
| - | **UPDATE: 5 April 2010** This technique does not appear to properly translate MySQL BLOB (binary) data. ''mysqldump'' dumps the blob as a binary string, which is represented in the dumpfile as a series of characters with a latin1 encoding. When ''iconv'' comes through, it //changes// the binary representation of those characters into the UTF-8 encoding, which corrupts the underlying binary data. | + | **UPDATE: 6 April 2010** This technique does not appear to properly translate MySQL BLOB (binary) data. ''mysqldump'' dumps the blob as a binary string, which is represented in the dumpfile as a series of characters with a latin1 encoding. When ''iconv'' comes through, it //changes// the binary representation of those characters into the UTF-8 encoding, which corrupts the underlying binary data. |
| The only solution I've found so far is to manually copy the binary data afterwards from the old DB to the new DB, using a multi-database ''UPDATE'' query like this: | The only solution I've found so far is to manually copy the binary data afterwards from the old DB to the new DB, using a multi-database ''UPDATE'' query like this: | ||