Hello everybody, this is my first post.
I also had the problem with my MySQL-Lazarus setup where accentued characters where replaced by question marks: ???.
I then understood today that if my database definition, my MySQL server, my Lazarus application were all using UTF8 encoding, my actual text was still in latin1 inside the database.
So the solution was just a matter of converting my ISO_8859-1 encoded text that was inside an UTF8 database into real UTF8 encoded data inside an UTF8 database. This is what you can do to get to it:
- 1 Create a mysql dump backup:
mysqldump --databases --add-drop-database --add-drop-table --add-locks [your-database] > data-dump.sql
Be sure that each table is defined with
DEFAULT CHARSET=utf8;.
- 2 Convert the content of the dump file into UTF8 text:
iconv -f ISO_8859-1 -t UTF-8 data-dump.sql > new-data-in-utf8.sql
- 3 Import back the UTF8 text into the database:
mysql < new-data-in-utf8.sql
After that procedure, everything is in UFT8, you don't have to use any function like
AnsiToUTF8() or else to get the right display in your FreePascal application.