0

I have created a python script which reads .xlsx files with openpyxl and send data to MySQL database. The database interclassement is utf8_unicode_ci.

On this data I get an error: Beam 40 x 75

The error is:

Incorrect string value: '\xF0\x9D\x99\xB8 a...' for column ...

It is about the character:

How is it possible to replace "not allowed" chars by spaces (and not every other like é, è, ... which cause no problems?

Friedrich
  • 2,211
  • 20
  • 42
  • This is a perfectly good Unicode character: https://www.fileformat.info/info/unicode/char/1d678/index.htm - I think the problem is rather caused by the fact your database uses the obsolete "mb3" type instead of utf8mb4: https://stackoverflow.com/questions/30074492/what-is-the-difference-between-utf8mb4-and-utf8-charsets-in-mysql – Błotosmętek Apr 19 '20 at 23:17

1 Answers1

0

MATHEMATICAL MONOSPACE CAPITAL I is available in "UTF-8", which is available in MySQL's CHARACTER SET utf8mb4, but not utf8.

Change the charset for (at least) the column that you are loading that value into.

Rick James
  • 135,179
  • 13
  • 127
  • 222