Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-12

CP_NONE string disappearing

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Benito van der Zander

Hello,

this code:

program Project1;
{$mode objfpc}{$H+}
var a,b, c: string;
begin
   a := 'x';
   b := 'y';
   SetCodePage(RawByteString(b), CP_NONE, false);
   c := a+b;
   writeln(c);
end.

prints x without y on win32/wine.

Is that supposed to happen?

Bye,

Benito

Reply by email

Jonas Maebe
to Benito van der Zander
Benito van der Zander wrote 16 lines
this code: program Project1; {$mode objfpc}{$H+} var a,b, c: string; begin   a := 'x';   b := 'y';   SetCodePage(RawByteString(b), CP_NONE, false);   c := a+b;   writeln(c); end. prints x without y on win32/wine. Is that supposed to happen?

https://wiki.freepascal.org/FPC_Unicode_support#Code_page_identifiers

"CP_NONE: this value indicates that no code page information has been associated with the string data. The result of any operation on a string that has this dynamic code page is undefined."

Jonas

Reply by email