UTF8ToCP852 function
Converts a string from UTF-8 encoding to Code Page 852.
Declaration
function UTF8ToCP852(const s: string; SetTargetCodePage: Boolean=False)
: RawByteStringDescription
UTF8ToCP852 is a
RawByteString function used to convert
a UTF-8-encoded string to the Code Page 852 (DOS Central Europe) encoding.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Central Europe code page (852). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP852 to perform character conversions needed for the target encoding.
UTF8ToCP852 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
