0

I have some troubles with the Zeos library in Delphi 2009. I have a MySQL database with utf8_bin encoding and when i'm trying to retrieve some strings from the DB and display it with a DBGrid the DBGrid is displaying the word (BYTES) and not the actual string.

I tried to change some settings but in vain. After a lot of effort , i downloaded the Trial edition of the "DAC for MySQL" and oddly enough everything worked perfectly.

The program is a very simple program with a Zconnection, a Ztable, a datasource and a DBGrid. The numbers are displaying correctly , only the strings have this problem. I tried different things but i have not idea what more i can do.

the MySQL version is 5.6.24

ZEOSlib 7.1.4-stable

If anyone have a suggestion please help me ! Thank you for your time (i'm sorry for my bad english )

RRUZ
  • 134,889
  • 20
  • 356
  • 483
zaos
  • 1

1 Answers1

0

I've had quite the same problem with MySQL 5.6-23 And ZeosLib 7.1.4-stable with Delphi XE7.

My TZConnection is initialized with :

  • ClientCodePage to latin1
  • ControlsCodePage to cCP_UTF16
  • Properties to
    • AutoEncodeStrings=ON
    • controls_cp=CP_UTF16
    • codepage=latin1
  • protocol mysqld-5

My database was created with a default charset and collation (utf8/utf8_bin), and i had the same problem than yours, even with latin1/latin1_bin

Then I have changed the database by CREATE DATABASE IF NOT EXISTS MyDbName CHARACTER SET latin1 COLLATE latin1_general_cs and then all works fine

Hope it would be help you.

JMC
  • 1
  • Thank you very much for your response , the problem in this solution is that i must change the collation from utf8_bin to latin1_general_cs , i prefer to avoid that and stick to utf8. – zaos Sep 17 '15 at 15:21