I have a web application written in PHP which using MySQL as database back-end.
To store my language(Thai) data, I'm using tis620 charset on my database tables, this setting is great for my web application at the moment.
I'm going to write a Windows application to access the same database as my web application, but I have faced the problem about retrieving data from tis620 fields.
This is my table's default collation, using tis620

For testing purpose, I setup the eng field's collation to use utf8

I inserted one sample record to the table

I'm using Oracle's MySQL Connector/ODBC 5.1 as ODBC driver, and tried both setup as utf8 and tis620

I'm using Delphi 5, TTable to connect the the database table
field(s) with tis620 (table's default) cannot be retrieved

Please give me some advices, tis620 is best suit to my web application at the moment, if I converted the fields to utf8 I solve this problem but I will have a problem to my web application instead.
So how to use BDE Data Access component (TTable, TQuery) to retrieve data from tis620 field(s)?
Please help.
Thanks everyone.
Did you use "Thai" as your language for Non Unicode applications in your Windows settings? Delphi 5 applications can work very well with Thai and English at the same time. What you can not do out of the box is to mix charsets. But I suspect you do not need full Unicode, just to display some Thai and English content.
Then set the code page Win-874 in your ODBC driver.
Or you can switch from the deprecated BDE to a newer library. If you are stick to Delphi 5, I recommend to test FreeDAC which supports natively:
Of course, this library is deprecated (in favor to its AnyDAC/FireDAC evolution), but it is AFAIK one of the best solution for Delphi 5. And it is free, with sources. And IMHO it is much preferred to any ADO-based components, in the Delphi world.
If you use FreeDAC, you won't need to configure ODBC (nor the BDE, of course), since it provides direct access to MySQL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With