Search found 31 matches

by cnliou
10.05.2013, 09:57
Forum: User Patches
Topic: Patch to 6.6.6 fixing single quote becoming \047
Replies: 0
Views: 1800

Patch to 6.6.6 fixing single quote becoming \047

Newer versions of PostgreSQL appears to handle escape syntax differently from older ones. Version 9.2 takes literals like these two SQL text: INSERT INTO t1 VALUES (E'This is Jim\'s home.') INSERT INTO t1 VALUES (E'This is Jim\047s home.') Take special note on the prefixing character "E"! ...
by cnliou
10.11.2011, 14:32
Forum: User Patches
Topic: Switching Client Encoding for PostgreSQL
Replies: 7
Views: 2750

Using the 3 step cast as in the example doesn't work either? - Create IZPostgresSQLConnection object variable - Assign this variable a value by casting - Use the var->SetCodePage() function. No, this can't compile: IZPostgreSQLConnection *c=static_cast<IZPostgreSQLConnection *>(ZConnection->DbcConn...
by cnliou
10.11.2011, 13:32
Forum: User Patches
Topic: Switching Client Encoding for PostgreSQL
Replies: 7
Views: 2750

I think you better read this article : http://zeos.firmos.at/kb.php?mode=article&k=14 It's the SQLite specific implementation of encryption functionionality. It shows how you can use code to call db-specific dbc layer functions. What do you think? Can you manage this change for the postgres dri...
by cnliou
09.11.2011, 10:12
Forum: User Patches
Topic: Switching Client Encoding for PostgreSQL
Replies: 7
Views: 2750

It will be fine for myself to make SetCodePage() available only to PostgreSQL. However, I don't know how to directly call zdbc procedures from my application. If you can show me how, I can try exporting SetCodePage() to zdbc instead of TZConnection. I have read http://zeos.firmos.at/kb.php?mode=art...
by cnliou
09.11.2011, 03:38
Forum: User Patches
Topic: Switching Client Encoding for PostgreSQL
Replies: 7
Views: 2750

I have just quickly reviewed mysql, sqlite, and interbase6. It appears to me that none of them reacts to the change of "codepage=..." after connection, and sqlite even completely ignores this parameter. It will be fine for myself to make SetCodePage() available only to PostgreSQL. However,...
by cnliou
08.11.2011, 15:11
Forum: PostgreSQL
Topic: Switching client encoding
Replies: 2
Views: 2477

I have fixed the issue and uploaded the patch to:

http://zeos.firmos.at/viewtopic.php?p=13813#13813

Hopefully the patch will be accepted and manually patched by some good soul :)
by cnliou
08.11.2011, 15:08
Forum: User Patches
Topic: Switching Client Encoding for PostgreSQL
Replies: 7
Views: 2750

Switching Client Encoding for PostgreSQL

This is the patch to fix the flaw as mentioned by myself at http://zeos.firmos.at/viewtopic.php?p=13794#13794 I have just fixed the flaw and the result looks fine. Summary of the rework: - Ignore entry "codepage=..." in TZConnection.Properties. That is said, setting this entry does not cha...
by cnliou
04.11.2011, 08:39
Forum: PostgreSQL
Topic: Switching client encoding
Replies: 2
Views: 2477

Switching client encoding

Hi! Client encoding is specified in TZConnection.properties such as "codepage=big5". It is then parsed and converted by Create(), and saved as FClientCodePage in ZDbcPostgreSql.pas. Such design works but it has the following flaws: (1) After connected to PostgreSQL, users can send "SE...
by cnliou
03.11.2011, 09:16
Forum: ZeosLib 7.0 Beta Forum
Topic: SOLVED: TZQuery.ParamByName bug: quoting apostrophe as \047
Replies: 9
Views: 1736

Confirmed: under Sqlite3 the above code works perfectly giving expected results. Well, so it looks like it's time to bug hunt for me! 8) The following message explains the reason: https://support.zabbix.com/browse/ZBX-4145 Quick and dirty temporary work around is explicitly turning off the followin...
by cnliou
22.12.2010, 07:33
Forum: ZeosLib 7.0 Beta Forum
Topic: When the ZEOS 7 new version for Delphi 2010 ?
Replies: 50
Views: 8886

I still have trouble getting answers for my corner case

At the VCL component level (e.g. TDataSet or TQuery Zeos versions), the type for strings will be the plain Delphi string type. For instance, SQL.Text will expect string type, i.e. UCS2 since Delphi 2009. The UTF-8 encoding will be used only at lower level, i.e. at ZDBC level. All the conversions wi...
by cnliou
21.12.2010, 09:41
Forum: ZeosLib 7.0 Beta Forum
Topic: When the ZEOS 7 new version for Delphi 2010 ?
Replies: 50
Views: 8886

- you've to call our custom UTF8ToString() or StringToUTF8() to convert to/from VCL string type - this will work for Delphi 6 up to XE and is very fast (avoid using Windows API most of the time); Please help me get your point. Zeoslib would not be quite usable if you mean the higher level applicati...
by cnliou
21.12.2010, 01:49
Forum: ZeosLib 7.0 Beta Forum
Topic: When the ZEOS 7 new version for Delphi 2010 ?
Replies: 50
Views: 8886

Therefore, if your DB uses UTF8 encoding and the client uses UTF16, then you should put "codepage=UTF16" (or maybe "codepage=UCS2"?). Then Zeos will tell the server to convert data to and from UTF16 (UCS2) encoding. The problem happens when the DBMS like PostgreSQL does not supp...
by cnliou
15.12.2010, 03:55
Forum: ZeosLib 7.0 Beta Forum
Topic: When the ZEOS 7 new version for Delphi 2010 ?
Replies: 50
Views: 8886

I beleive that most of those DBs will convert all data to client encoding before sending it to client (and in the oposite direction convet it from client encoding before storing it). Could this make your job simpler? Then, it does not matter if diferent tables and diferent columns in the base store...
by cnliou
11.10.2010, 05:21
Forum: ZeosLib 7.0 Beta Forum
Topic: [patch_done] Delphi 2010 + MySQL + UTF8
Replies: 51
Views: 13557

I am getting the feeling that the UNICODE issues are cross databases. What we actually need is perhaps a generic UNICODE implementation for all drivers. File "multibyte.c" in psqlODBC is an invaluable resource for us in terms of its quality. Please also refer to bug ID# 228: http://zeosbug...
by cnliou
08.01.2010, 15:08
Forum: PostgreSQL
Topic: Password autentication failed for user
Replies: 1
Views: 1040

I would suggest start with "unsecured" settings in pg_hba.conf:

local all all trust
host all all 127.0.0.1/32 trust

After the connection from ZEOSLIB succeeds, then set pg_hba.conf more secured.

(Remember to restart postgresql every time after changing pg_hba.conf).

Regards,
CN