MySQL Forums
Forum List  »  Performance

Re: Chinese data not appraing
Posted by: Rick James
Date: November 29, 2015 11:25AM

Suggest using utf8mb4 instead of utf8. However, that won't solve what you are seeing.

You are seeing "Mojibake" -- where non-English characters turn into multiple gibberish characters.

- The bytes you have in the client are correctly encoded in utf8 or utf8mb4 (good).
- You connected with `SET NAMES latin1` (or `set_charset('latin1')` or ...), probably by default. (It should have been `utf8mb4`.)
- The column in the tables may or may not have been `CHARACTER SET utf8mb4`, but it should have been that.

If you need to **fix the data** it takes a "2-step ALTER", something like

ALTER TABLE Tbl MODIFY COLUMN col VARBINARY(...) ...;
ALTER TABLE Tbl MODIFY COLUMN col VARCHAR(...) ... CHARACTER SET utf8 ...;

utf8mb4 is needed for Chinese and Emoji; utf8 suffices for most other languages.

Options: ReplyQuote


Subject
Views
Written By
Posted
1643
November 25, 2015 04:42AM
Re: Chinese data not appraing
845
November 29, 2015 11:25AM
892
November 30, 2015 01:24AM
877
December 01, 2015 06:14PM
894
December 02, 2015 01:12AM
837
December 07, 2015 01:22AM
822
December 07, 2015 10:24AM
745
December 08, 2015 08:58PM
816
December 09, 2015 01:04AM


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.