Encoding issues

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Yuusatsu
Posts: 2
Joined: Sun 30 Oct 2016 13:39

Encoding issues

Post by Yuusatsu » Sun 30 Oct 2016 13:50

I've got a website panel (it's set default to work with UTF8 characters) that allows me to import Excel data into MySQL database. The sheets often contain, for instance, Polish letters (ś, ę, ó, Ź, ł, Ż et cetera). Although in database I can see, for instance FABRYKA URZÄ„DZEŃ PRZEMYSŁOWYCH, the panel displays the characters properly, here it's FABRYKA URZĄDZEŃ PRZEMYSŁOWYCH.

Now, when I'm trying to display the very same data with my Delphi application, the data are fetched raw. No matter what settings I apply in TMyConnection, I can only see FABRYKA URZĄDZEŃ PRZEMYSŁOWYCH.

Has anybody got any idea on how to fix this?

Thank you in advance!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Encoding issues

Post by ViktorV » Mon 31 Oct 2016 09:03

To solve the issue, please try to set the TMyConnection.Options.UseUnicode property to True. For example:

Code: Select all

  MyConnection.Options.UseUnicode := True;

Yuusatsu
Posts: 2
Joined: Sun 30 Oct 2016 13:39

Re: Encoding issues

Post by Yuusatsu » Mon 07 Nov 2016 12:17

Unfortunately, this doesn't work. What's worse, these characters, when processed through TMyQuery are inserted raw, that is instead of an encoded character that PHP page can retrieve from the database and display properly, the data inserted is uncoded ("ś" in the database, ? marks on my website).

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Encoding issues

Post by ViktorV » Thu 10 Nov 2016 14:01

Most likely the issue is due to characters displaying on your PHP page, but not MyDAC. Please check in what coding characters are stored in the MySQL server database. For this you can use dbForge Studio for MySQL: https://www.devart.com/dbforge/mysql/studio

Post Reply