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

ConvertUTF8ToAnsi

Contains the routine used to convert from UTF-8 encoding to ANSI encoding.

Declaration

Source position: lconvencoding.pas line 132

var ConvertUTF8ToAnsi: TConvertUTF8ToEncodingFunc = Nil;

Description

ConvertUTF8ToAnsi is a TConvertUTF8ToEncodingFunc variable with the routine used to convert a string value from UTF-8 encoding to ANSI encoding. A routine which implements the TConvertUTF8ToEncodingFunc interface can be assigned to ConvertUTF8ToAnsi to the conversion.

The arguments to the routine include the UTF-8-encoded string converted in the function, and a boolean argument which indicates if the code page should be set for the string in the return value. Set the SetTargetCodePage parameter to True to set the code page for the ANSI string in the return value. The default value for the argument is False.

By default, a routine is NOT assigned to ConvertUTF8ToAnsi.

ConvertUTF8ToAnsi is called (when assigned) from the ConvertEncodingFromUTF8 routine.

See also

TConvertUTF8ToEncodingFunc

  

Specifies a function used to convert a string value from UTF-8 encoding to another encoding with an optional code page.

ConvertEncodingFromUTF8

  

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


Version 4.0 Generated 2025-05-03 Home