Knowledgebase
UTF-8 issue after MySQL server update 5.x to 8.x
Posted by Esvon Support on 14 June 2024 11:12 AM

Sometimes after MySQL server update to 8.x some things are not displaying as they should.

For example, the bullets are • iv,  characters appear on empty lines or in other whitespace, and apostrophes are replaced by ’ , and many other things that look weird and seem encoding-related.

Newly added data doesn't display this behaviour.

This problem is encoding related and usually is result of your export/import strategy.

The weird chars come from UTF-8 data that was originally stored as Latin-1 and then not converted correctly to UTF-8.

If you still have access to the old database, you can try exporting it using command like this:

mysqldump -uDBUSER -pDBPASS -r db.sql --default-character-set=latin1 --skip-set-charset --no-tablespaces DBNAME

If the old database is not available or not up to date, the data is probably still recoverable; you'll need a MySQL function like

convert(cast(convert(v_descr using latin1) as binary) using utf8)

Here is how you can test it on one record initially:

update ec5_ad set v_descr = convert(cast(convert(v_descr using latin1) as binary) using utf8) where link_id=1


Help Desk Software by Kayako Fusion