[fpc-pascal] Weird string behavior

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jul 25 23:07:33 CEST 2016


On Mon, 25 Jul 2016 22:25:59 +0200
Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:

> On 23/07/16 13:31, Petr Kohut wrote:
> > Hello,
> > here are results:  
> 
> Thanks a lot. Could you test one more? I think I will have all 
> information I need then.
> 
> 
> Jonas
> 
> {$APPTYPE CONSOLE}
> 
> type
>    tcp866 = type ansistring(866);
> var
>    s1, s2, s3: tcp866;
> begin
>    s1:='abc';
>    setcodepage(rawbytestring(s1),65001,false);
>    s2:='def';
>    setcodepage(rawbytestring(s2),437,false);
>    s3:=s1+s2;
>    Writeln('DefaultSystemCodePage = ',DefaultSystemCodePage);
>    Writeln('s3 = "', s3, '" cp = ', StringCodePage(s3));
>    Readln;
> end.

DefaultSystemCodePage = 1252
s3 = "abcdef" cp = 65001

Mattias



More information about the fpc-pascal mailing list