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

UTF8ToSys

Ensures UTF-8 characters (or format settings) are converted to the system code page.

Declaration

Source position: lazutf8.pas line 45

function UTF8ToSys(

  const s: string

):string; overload;

function UTF8ToSys(

  const AFormatSettings: TFormatSettings

):TFormatSettings; overload;

Arguments

s

  

Value to examine in the function.

Function result

Value for the string after conversion.

Arguments

AFormatSettings

  

Format settings to examine in the function.

Description

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

Utf8ToAnsi

TFormatSettings


Version 3.2 Generated 2024-02-25 Home