Page 1 of 1
[patch_done] PostgreSQL UTF8 Charset Patch R5 for 6.6.3
Posted: 11.08.2008, 07:45
by whitekid
Here is PostgreSQL utf8 Patch for Zeoslib 6.6.3 Stable.
It only tested on Delphi 2007
You need to set TZConnection.Options as
Code: Select all
codepage=utf8
client_encoding=utf8
ps. This patch only tested on D2007. on D7 or below this patch make comile error that unknown identifier
ftWideMemo type missed in TFieldType(DB.pas).
If you use D7 please help me to solve this problem..
Posted: 11.08.2008, 07:58
by whitekid
If you apply this patch on D7. You need to map TEXT type to TWideString field.
follow this step
STEP1: replace all ftWideMemo usages to using conditional directive
ex) {$IFNDEF VER150BELOW}ftWideMemo{$ENDIF}
STEP2: change the type mapping:
in src/component/ZDatasetUtils.pas patch
- stUnicodeString, stUnicodeStream:
+ stUnicodeString:
Result := ftWideString;
+ stUnicodeStream:
+ Result := {$IFDEF VER150BELOW}ftWideString{$ELSE}ftWideMemo{$ENDIF};
It may be OK(but not tested. I have no D7). If this steps are work OK please send me the modified patch.
Posted: 11.08.2008, 08:11
by mdaems
Thanks a lot Whitekid.
I'll try to apply this patch to Testing branch when I find some time. It's not very probable we will add this patch to a 6.6.X version.
Normally this privilege is reserved for real bug fixes. The change you did is likely to have impact on programs using the 6.6.3 version who did already handle the stUnicodeStream as a stWidestring. We can't ask users of a stable version to change this again, I think.
Mark
Posted: 11.08.2008, 08:21
by whitekid
We can't ask users of a stable version to change this again
I totally agree with you. and I hope this patch will be incldued next release(may be 6.7.X)
Posted: 13.08.2008, 11:41
by mdaems
I think you made a small typo. But tell me if I'm wrong.
Code: Select all
+++ src/component/ZSqlProcessor.pas Fri Aug 08 17:21:48 2008
@@ -506,6 +506,15 @@
Stream.Free;
end;
end;
+ ftWideMemo:
+ begin
+ Stream := WideStringStream(Param.AsWideString);
+ try
+ Statement.SetAsciiStream(I + 1, Stream); <<---- SetUnicodeStream??
+ finally
+ Stream.Free;
+ end;
+ end;
ftBlob, ftGraphic:
begin
Stream := TStringStream.Create(Param.AsBlob);
Posted: 13.08.2008, 12:27
by mdaems
Done SVN rev 414.
Please test. Test suite didn't fail with mysql. I hope there will be no trouble with other databases.
Mark