Sign in Join

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

Mailing lists / fpc-pascal / 2021-09

How to create AnsiString with specific code page?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Abuy

I need string with Windows-1251. Tried var msg: AnsiString(1251) but this does not work. What I am doing now is

var msg: rawbytestring;
begin
   SetCodePage(msg, 1251, True);
end.

Reply by email

Bart
to Abuy
PM Abuy wrote
I need string with Windows-1251. Tried var msg: AnsiString(1251) but this does not work. What I am doing now is

This should work

type
  StringCP1251 = AnsiString(1251)
var
  S: StringCP1251;
Bart

Reply by email