I have just tried this patch in a small test project, and it seems to fix all my problems except one -- if I try to add a SQL statement that uses a UTF character to the SQL strings of a query object, when I activate the query I get an error. If I use the same character in a filter, it works correctly with no problem.
I can get around the SQL problem by using the AnsiToUTF8 function, but it seems like it ought to be able to work without doing this, since the filter will work.
Thank you so much for this patch!! It is a HUGE help! I just wanted to point out the one remaining problem so you could make it absolutely perfect.
Thanks again
Bill
The 6.6.2 patch works fine for varchar fields, but text fields do not work AT ALL now. Only one character seems to get into the text field.
I did not check the code before the patch to see if text fields worked correctly then.
The problem seems to be in the zdbcPostgreSQLStatement module around line 350 where it is encoding the unicode string from the stream. If I try to put a string like 'abc' into a text field, TempBlob.GetString gives "'a'#0'b'#0'c'#0" and the EncodeString returns "a\000b\000c\000". It seems to take "\000" as the end of the string, so when I look at the data in the field in pgAdminIII all that is there is "a". So I think the escape character encoding that is being used is bad for the data it gets from the stream. Do the 0s really have to be included in the encoding? It seems like they really ought to be skipped.
If I try to put a string like "a£a" in, I get an error because it does not like the "£".
I really need a couple of fields with unlimited text length. What can I do?
I have the codepage and client_encoding set to utf8 in the connection properties.
I tried it once using "£" (which caused errors before) and it worked fine.
Your patch is much more elegant and black belt than the hack I came up with. Since you are Korean I assume you have tested it extensively with Korean characters, which also increases my level of confidence in the patch a LOT.
Hi! Please write me. Where define TWideMemo class?
I patching 6.6.3, but where compiling src have error: [Error] ZDatasetUtils.pas(321): Undeclared identifier: 'ftWideMemo'.
Maybe patching only work on the 6.6.2rc version? But I not found defined TWideMemo class inside.
No. If it was there would be a 'check mark icon' in the post title.
I can't find ftWideMemo in D7 help. Does anybody know since what Delphi and Fpc/Lazarus version this field type exists? (I see it's present in fpc 2.2.0)
As Delphi 7 is still commonly used we can't include the patch 'as is'. Anybody feels like correcting the patch to take this into account? Testing branch is 'available' now... I commit as soon as I get it compiled in D7 and Lazarus. If nobody does correct the patch, it will take longer to get in... but we'll have a look at it in due time.