Brainstorming about ClientCodePage

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 787
Joined: 18.11.2018, 17:37
Location: Hungary

Brainstorming about ClientCodePage

Post by aehimself »

Yesterday when I was travelling home from work I started to think. ClientCodePage defines in what encoding strings arrive from the database (which at the end gets converted to Unicode). This is clear until now.

Let's say I have an application to store books, accessing the data with ZQuery.FieldByName('field').AsString. Only one application is accessing this database, not cross platform, no DB "hacking" with management applications (should :D) happen.
This application has a config file to store the database properties. User name, host name, password, etc.

And now to the real question. In this context, should we allow the user to change the ClientCodePage via the config file? I mean if data is only read and written to the database by this application and I keep the encoding on (protocol specific) UTF8, it should always work, no? In what scenarios NOT allowing changing the encoding can cause issues?

This is only a theoretical question, but any insight is appreciated :)
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: Brainstorming about ClientCodePage

Post by Fr0sT »

I could seem rather radical but I'd say codepages are for legacy stuff only, modern stuff should use utf8 everywhere and forget about codepages at all
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 787
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Brainstorming about ClientCodePage

Post by aehimself »

@Frost, am I right to assume that you just confirmed my thought? In the above scenario - unless some unauthorized data modification happen - it must always work as planned? And finally I did not overlook anything? :D
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: Brainstorming about ClientCodePage

Post by Fr0sT »

Unfortunately (or fortunately :))) ) I've no experience in multi-language DB apps but I'm pretty sure than in modern world the real need in codepages is very very rare. So yes, I guess you're right
Post Reply