How to know when to post Unicode or Ansi data?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

How to know when to post Unicode or Ansi data?

Post by upscene » Wed 12 May 2010 15:15

Hi,

Given the following table:

Code: Select all

CREATE TABLE test_table (
  I         Integer(11),
  txt       Text CHARACTER SET utf8 COLLATE utf8_general_ci,
  txt_ascii Text CHARACTER SET latin1 COLLATE latin1_swedish_ci, 
  PRIMARY KEY (
      i
  )
) ENGINE=MyISAM ROW_FORMAT=dynamic DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
How do I know when unicode data is accepted when editing a grid?

If I set UseUnicode to True in the connection component, both of the Text columns come back as WideMemo, if I do not, both seem to come back as Memo.

Got a clue?

With regards,

Martijn Tonies
Upscene Productions

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

Post by Dimon » Thu 13 May 2010 08:14

The point is that on connection establishment MySQL server requires specifying of character set, and after this all data is encoded to this charset by MySQL sever. Therefore we don't notice differences between the txt and txt_ascii fields, because MySQL server returns the same field description for both these fields.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 13 May 2010 09:19

Dimon wrote:The point is that on connection establishment MySQL server requires specifying of character set, and after this all data is encoded to this charset by MySQL sever. Therefore we don't notice differences between the txt and txt_ascii fields, because MySQL server returns the same field description for both these fields.
So, you would say: let the user decide?

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

Post by Dimon » Thu 13 May 2010 09:45

Yes, it is correct.

Post Reply