mysqldump re-encoding utf8 multi-byte characters
Posted by: Ely Peddler
Date: January 08, 2011 10:36AM

I am dumping a utf8 database (see details at end of post) using mysqldump and the resulting file has all the multi-byte characters re-encoded.

For example the £ character is correctly encoded in the database as £ but appears in the dumped file re-encoded as Ã<0x82>£ (Ã<0x82> is utf8 encoding of Â, £ is utf-8 encoding of £)

I checked the database using phpmyadmin which reports £ and using the mysql command-line too which reports £.

I've checked the file's contents using hexdump and it shows the 4 bytes.

I'm not redirecting output I'm using the -r option

My server is Linux.

If I then try to use the dumped file to regenerate the database the new database has the wrong encodings unsurprisingly.

I've read several posts on this subject but none of them seem to answer my issue.

# Server version: 5.0.91-log
# MySQL charset: UTF-8 Unicode (utf8)
# MySQL connection collation: utf8_unicode_ci

All tables have collation utf8_general_ci

Options: ReplyQuote

Written By
mysqldump re-encoding utf8 multi-byte characters
January 08, 2011 10:36AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.