different charset how to process

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

different charset how to process

Post by Thomas J. » Tue 08 Sep 2009 07:07

Hello all,

I have to import an Excel File and in this file could be Cyrilic, Chinese or Japanese.
How do I have to set the "Charater Set" and "Collation" on server side and what do I have to set in TMyConnection and TMyQuery.

I'm using C++Builder 8.

Thanks for your help.
Thomas

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 08 Sep 2009 08:34

To solve the problem you should use the TMyConnection.Options.Charset property.
You can find more detailed information about this option in the MyDAC help.

Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

Post by Thomas J. » Wed 09 Sep 2009 13:34

So I tried it.
I have a MySQL database with UTF-8 and I have MySQL Table with UTF-8.
I set the TMyConnection->Option->Charset = "utf8".
I tried to import the data with TQImport3Wizard from EMS and I also tried it with the components of www.scalabium.com.
Both without success. In both cases I see in the database "???" but no cyrillic character.

If I import the data with NaviCat everything is fine. And I cannot believe that both component provider are not able to handle UTF-8. Did I miss something with your component?
Do you have an example importing Excel into MySQL table with UTF-8?

Thanks Thomas

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 10 Sep 2009 07:09

Please try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

Post by Thomas J. » Thu 10 Sep 2009 09:12

Hi Dimon,

now I was able to import the data with TQImport3Wizard.
And the problem was, that setting of the Option in TMyConnection.
I set the Option TMyConnection->Option->Charset = "utf8" and this is not correct. I tried it with TMyConnection->Option->UseUnicode = true;

Thanks
Thomas

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 10 Sep 2009 11:04

It is good to see that this problem has been solved.

Post Reply