[fpc-devel] Unicodestring branch, please test and help fixing

ABorka fpc-devel at aborka.com
Thu Sep 11 19:26:50 CEST 2008


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.




More information about the fpc-devel mailing list