Sign in Join

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

Mailing lists / fpc-pascal / 2019-01

Conversion of buffer of UnicodeChars to AnsiString

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

LacaK

Hi,

is there smarter way how to convert buffer of UnicodeChars to AnsiString taking into account codepage conversion as:

as := String(UnicodeCharLenToString(buffer, buflen shr 1));

?

And second question if I want to avoid warnings: "Implicit conversion from WideString to AnsiString ..." in cases:

as := ws;

I must use only explicit typecast:

as := AnsiString(ws); ?

-Laco.

Reply by email