Hi All,
Banging my head over this...
In my firebird 2.5 database all varchar fields are UTF-8.
The DB connection is UTF-8.
I use Zeos components in a console/server application in Free Pascal.
The ZConnection has all properties set to UTF-8.
At this application, a JSON arrives with a text containing UTF8 chars.
This should be posted into a FB table via a Zeos zquery that calls an SP.
The text arrives properly at the application, checked by writeln(atext);
Then I want to put it in the zQuery's parameter:
params.parambyname('atext').asString:=atext;
wrong result, garbage text where special characters are. But I thought all Free Pascal strings {$H+} are now UTF8?
Ok, next try:
params.parambyname('atext').asUnicodeString:=atext; Allmost good, it appears nicely in the table (checked by IBExpert) BUT it adds a chr(0) at the end.
I can't figure out where the #0 comes from...