[fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversion

Tobias Giesen tobiasgiesen at gmail.com
Mon Apr 4 10:08:14 CEST 2016


Hello,

my application uses the AnsiString type to store UTF-8 data. That was
totally fine. Now in FPC 3, automatic conversions cause data loss. I
get question marks replacing Chinese characters, for example.

I do not fully understand at which points these conversions are done.
The FPC 3 Unicode documentation says something about "passing it to a
RTL routine".

What about this code:
var a,b:Ansistring;
begin
  a:=Utf8Encode(AWideString);
  b:=Copy(a,1,10);
  end;

Is "Copy" an RTL routine? Is this OK or not?

Best for me would be to be able to turn the conversions off completely.
Is that possible?

Cheers,
Tobias





More information about the fpc-pascal mailing list