0

Seem to have a bit of a character encoding issue with MariaDB on AWS that I can't seem to resolve;

Statement could not be executed (22007 - 1366 - Incorrect string value: '\xA320 Of...'

Initially I presumed this was because the table was set to latin1 but I've since changed the table and the column to utf8mb4_unicode_ci and the error persists.

enter image description here

Matthew
  • 596
  • 1
  • 8
  • 29

1 Answers1

1

Since your column definition is utf8, you also need to insert utf8 data.

\xA320 is not a valid utf8 character:

mysql> select convert(X'A320' using utf8mb4);
+--------------------------------+
| convert(X'A320' using utf8mb4) |
+--------------------------------+
| ?                              |
+--------------------------------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------+
| Level   | Code | Message                                   |
+---------+------+-------------------------------------------+
| Warning | 1300 | Invalid utf8mb4 character string: '\xA3 ' |
+---------+------+-------------------------------------------+
1 row in set (0.00 sec)
Georg Richter
  • 5,970
  • 2
  • 9
  • 15