0

I've been trying to convert and have this table support Chinese characters but MySQL keeps resisting with this error. Incorrect string value "\xE9\x80". At first, I thought it was because of this "utf8 vs utf8mb4" mess, but even though I converted everything to utf8mb4 I kept getting the error for this particular row. There are many other Chinese encoded rows in the table and they all seem/work fine except this character: E9 80 92. And the thing is, it's not even a 4-byte UTF-8 character, so I assume even utf8 charset should work with it. Am I missing something here?

MySQL Server: 5.5.43 Dev-Env: Delphi 7 (not using Unicode connection options to bypass UTF8Encode/Decode functions, boy they really screw things up)

Table Def:

CREATE TABLE dfSvc (
    id INTEGER, 
    sName VARCHAR(1000)) CHARACTER SET=utf8mb4;
Brian Hawk
  • 728
  • 2
  • 12
  • 24
  • `\xE9\x80` does not make a complete character in utf-8, and the next byte cannot be \x27 because it doesn't have the top bit set. What character are you trying to insert? – Joni Nov 16 '16 at 21:02
  • Joni, you beat me to it. I was about the correct the 3rd byte. It was 92 – Brian Hawk Nov 16 '16 at 21:12
  • 1
    From the error message it looks like the final byte doesn't make it to the database. Does the text fit in the column? The limit on the size of the column is in bytes, not characters... Also, 92h encodes a closing single quote in cp1252 that is often transliterated as the apostrophe 27h, may explain the initial confusion – Joni Nov 16 '16 at 21:38
  • Joni, that's it! thx a lot. At some point from my code down to actual sql comm, 92h becomes 27h. I just need to figure out where and fix it. Please write a short answer so I can honor it. – Brian Hawk Nov 16 '16 at 21:41
  • How long is the string? What are the connection settings for Delphi? – Rick James Nov 17 '16 at 01:46

0 Answers0