UTF8ToSys function
Ensures UTF-8 characters (or format settings) are converted to the system code page.
Declaration
function UTF8ToSys(const s: string): string; overloadDescription
UTF8ToSys is an overloaded function used to convert the specified
string value (or format settings) to the system codepage for the platform.
UTF8ToSys works like
UTF8ToAnsi, but is more independent of
WideStringManager. For platforms where UTF8_RTL is not defined, and
NeedRTLAnsi returns
True, UTF8ToAnsi is called to convert non-ASCII
values in
s. For platforms where UTF8_RTL is defined, the value in
s is used without modification.
An overloaded variant of the function handles TFormatSettings for
the platform. The return value for the function is the specified values in
AFormatSettings after being updated to reflect the system codepage
for the platform. For platforms where UTF8_RTL is not defined, the values in
the following format settings are updated: CurrencyString,
LongMonthNames, ShortMonthNames,
LongDayNames, and ShortDayNames.
No actions are needed for platforms where UTF8_RTL is defined.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
