[fpc-pascal] Weird string behavior

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Jul 23 13:03:33 CEST 2016


On 23/07/16 12:58, wkitty42 at windstream.net wrote:
> On 07/23/2016 06:13 AM, Jonas Maebe wrote:
> [...]
>> var
>>   s1,s2,s3: AnsiString;
>>   r1,r2,r3: RawByteString;
>> begin
>>   s1:='A';   // 1252
>>   s2:='AƤ';  // 1252
>>   writeln('s1="',s1,'" cp=',StringCodePage(s1));
>>   writeln('s2="',s1,'" cp=',StringCodePage(s2));
>
> writeln('s2="',s2,'" cp=',StringCodePage(s2));
>
>
> you're not the only one to have missed that...

The only thing that matters for this test is the stringcodepage value, 
which is the correct one.


Jonas



More information about the fpc-pascal mailing list