[fpc-pascal] code example where AnsiString used in FCL (SqlDB) causes data loss

LacaK lacak at zoznam.sk
Wed May 11 14:33:27 CEST 2016


>
>
>
> I just double checked my results again. With u: String variable and
> compiled with FPC 3.0 and running in a Latin-1 environment, data is
> completely corrupted.
It will be good to know where this happens.
Because AFAIK fcl-db internaly uses AnsiString/String so assigning 
between them should not trigger any code page conversion.
So if you fetch UTF-8 data from database and then you move them between 
various string instances, they should be preserved.
(no matter than ACP of String is Latin1)
So in end when you save this data to file they should still be UTF-8 
encoded ?
Can you dump binary content of "u" before is saved to file ?
-Laco.




More information about the fpc-pascal mailing list