Page 1 of 1

"?" characters instead of foreign characters

Posted: Fri 30 Apr 2021 08:27
by starhu
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!

Re: "?" characters instead of foreign characters

Posted: Wed 05 May 2021 09:48
by ViktorV
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

Re: "?" characters instead of foreign characters

Posted: Wed 05 May 2021 10:46
by starhu
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!

Re: "?" characters instead of foreign characters

Posted: Wed 05 May 2021 11:10
by ViktorV
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

Re: "?" characters instead of foreign characters

Posted: Wed 05 May 2021 12:27
by starhu
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!

Re: "?" characters instead of foreign characters

Posted: Fri 07 May 2021 10:39
by ViktorV
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