Some conversion problem occurs and empty string put into a TListbox if I try to get a field value with some special characters from a SQL result. (using Zeos)

The database field can contain any string with '®' in it for this to happen
for example: 'sometext®'

It seems that

ListBox1.Items.Add(SQL1.FieldByName('MyTableField').AsString);

or even

var s:string;
begin
  s:=SQL1.FieldByName('MyTableField').AsString;
  ListBox1.Items.Add(s);
end;

will only put an empty string into the Listbox.
Somewhere inside FCL, where the Listbox item is inserted there is a UTF8Decode which ends up with the empty string because of the '®' #174 character it thinks that it is a unicode encoded character and tries to get the additional bytes for it which ain't there.

used the Lazarus-0.9.25-16495-fpc-2.2.3-20080909-win32.exe build


Not sure how can this be circumvented (using some conversion function?) or if it is a bug.

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to