0

I can't save some data in my mysql database.

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3' for column 'title' at row 1

row title use the collation utf8mb4_unicode_ci.

What's wrong with it? How could I save my data?

PS: I try pretty much every solution give in stackoverflow. That why I create a new thread.

Sancho
  • 1,157
  • 1
  • 19
  • 43
  • Some 8-bit data is leaking into your UTF-8 world. You need to find out where that came from. – tadman May 31 '21 at 08:09
  • Since that's an à it's probably something that is UTF-8, got mangled back into ISO Latin 1, and then smashed into your column again as UTF-8, but it's not UTF-8 now. – tadman May 31 '21 at 08:10

1 Answers1

0

C3 may indicate a utf8 character being interpreted as latin1. Or it may indicate "double encoding".

SHOW VARIABLES LIKE 'char%';

See... utf8

The solution is probably to connect with utf8mb4, not with the default.

What version of MySQL are you using? What parameters does Doctrine use when connecting?

Rick James
  • 122,779
  • 10
  • 116
  • 195