Sign in Join
FPDoc Onlineexperiment

SysToUTF8 function

In unit LazUTF8

Converts strings (and format settings) from the system codepage to UTF-8.

Declaration

pascal
function SysToUTF8(const s: string): string; overload

Arguments

s

Values to examine in the function.

Function result

Values after conversion to UTF-8.

Description

SysToUTF8 is an overloaded function used to convert strings (and format settings) from the system codepage to UTF-8. SysToUTF8 works like AnsiToUTF8, but has no reliance on the widestring manager on platforms where UTF8_RTL is defined. For platforms where UTF8_RTL is not defined, and NeedRTLAnsi contains True, non-ASCII values are converted to UTF-8 by calling AnsiToUTF8.

An overloaded variant of the function handles TFormatSettings for the platform. The return value for the function is the values specified in AFormatSettings after conversion from the system codepage to UTF-8. The values in the following format settings are updated: CurrencyString, LongMonthNames, ShortMonthNames, LongDayNames, and ShortDayNames.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.