[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LConvEncoding' (#lazutils)

UTF8ToCP850

Converts a string from UTF-8 encoding to Code Page 850.

Declaration

Source position: lconvencoding.pas line 192

function UTF8ToCP850(

  const s: string;

  SetTargetCodePage: Boolean = False

):RawByteString;

Arguments

s

  

UTF-8-encoded string value converted in the routine.

SetTargetCodePage

  

True if the target code page is set in the return value, False if a code page is not used.

Function result

String value after conversion to Code Page 850.

Description

UTF8ToCP850 is a RawByteString function used to convert a UTF-8-encoded string to the Code Page 850 (DOS Western Europe) encoding.

For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Western Europe code page (850). 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 UnicodeToCP850 to perform character conversions needed for the target encoding.

UTF8ToCP850 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.

See also

ConvertEncodingFromUTF8

  

Converts the encoded value from UTF-8 to the encoding with the specified name.

UTF8ToSingleByte

  

Converts a UTF-8-encoded string value to a single-bye character set using a conversion function.

SetCodePage


Version 3.2 Generated 2024-02-25 Home