"?" characters instead of foreign characters

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
starhu
Posts: 34
Joined: Thu 13 Aug 2009 12:13

"?" characters instead of foreign characters

Post by starhu » Fri 30 Apr 2021 08:27

Hello,

I upgraded MyDac 5 to 10.4.3 and after recompiling my applications, instead of the foreign characters I can see ? character.
For example instead of "ő" I can see "?".

What should I do?
The problem should be clearly with the compontent because I tried it with many grids and the result was the same.
Also, using any database editors like NaviCat show the correct characters.

Thank you for your help!

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

Re: "?" characters instead of foreign characters

Post by ViktorV » Wed 05 May 2021 09:48

Hey Starhu,

To solve the issue, please try setting TMyConnection.Options.UseUnicode property to True.
For example:
MyConnection.Options.UseUnicode := True;

If it does not solve the issue, please compose a small sample demonstrating the described behavior (including scripts for creating database objects) and send it to our team using the contact form
https://www.devart.com/company/contactform.html

Regards,
Viktor

starhu
Posts: 34
Joined: Thu 13 Aug 2009 12:13

Re: "?" characters instead of foreign characters

Post by starhu » Wed 05 May 2021 10:46

Hello Victor,

Unfortunately it didn't solve the problem.

-First, when I set Unicode:= true, I had a lot of "Type mismatch for field 'xxx', expecting: String actual: WideString" kind of messages
-Then I created DataTypeMaps so as not the get the messages above

-Then the result was bad:
-when Unicode:= false, then instead of the respective foreign characters I can see "?"
-but whe Unicode:= true, then instead of the respective foreign characters I can see the English correspondent e.g. instead of "ő" I can see "o", instead of "ű" I can see "u".

The database administrator programs show it correctly. I will create a sample.

Thank you!

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

Re: "?" characters instead of foreign characters

Post by ViktorV » Wed 05 May 2021 11:10

Hi Starhu,

Please note that if you have persistent fields created with UseUnicode=False, all varchar fields will be mapped to TStringField.
If you change UseUnicode to True and don't remove persistent fields, the following error will occur on dataset opening: "Type mismatch for field 'FIELDNAME', expecting: String actual: WideString".
This means that if you want to change the UseUnicode property, you should remove persistent fields.

It’s also possible that this issues may be related to new behavior in MyDAC 9.0.01: now, if the property TMyConnection.Options.Charset is not set, client charset is set to the value of the corresponding locale on the client computer. In order to solve the issue, you can set the TMyConnection.Options.Charset property to latin1.

If it does not solve the issue, please compose a small sample demonstrating the described behavior (including scripts for creating database objects and specifying the installed local on client machine) and send it to our team using the contact form below:
https://www.devart.com/company/contactform.html
Best regards,
Viktor

starhu
Posts: 34
Joined: Thu 13 Aug 2009 12:13

Re: "?" characters instead of foreign characters

Post by starhu » Wed 05 May 2021 12:27

Hi Viktor,

Thank you for your reply.

I set TMyConnection.Options.Charset property to latin1 and with UseUnicode := True it wasn't good,

... however with the "TMyConnection.Options.Charset=latin1 AND UseUnicode := False" combo, the foreign characters showed properly.

Thank you!

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

Re: "?" characters instead of foreign characters

Post by ViktorV » Fri 07 May 2021 10:39

Hi Starhu,

I’m glad that your issue is resolved now.
As for your second part of request, please note that these options are mutually exclusive, thus on setting UseUnicode property to True a value of Charset will be ignored.

Regards,
Viktor

Post Reply