[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Converts a UTF-8-encoded string value to a single-bye character set using a conversion function.
Source position: lconvencoding.pas line 203
function UTF8ToSingleByte( |
const s: string; |
const UTF8CharConvFunc: TUnicodeToCharID |
):string; |
s |
|
UTF-8-encoded string value converted in the routine. |
UTF8CharConvFunc |
|
Routine used translate Unicode code points to the singe-byte character set for the encoding. |
String value after conversion to an encoding using a single-byte character set.
UTF8ToSingleByte is used in an internal routine to convert the UTF-8-encoded value in s by calling the custom conversion routine in UTF8CharConvFunc. The return value is a string with the single-byte representation for the string value. UTF8ToSingleByte is called when the UseSystemCPConv compiler flag has not been defined for the platform, and system code pages are not available for the purpose.
No actions are performed in the routine when s is an empty string (''), and the return value is set to an empty string.
UTF8ToSingleByte iterates over the Unicode codepoints in s, and calls the routine in UTF8CharConvFunc for each of the codepoints. If a codepoint is not handled by the UTF8CodepointToUnicode routine, the value in ConvertEncodingErrorMode is used to determine the action taken for the character value. This includes:
UTF8ToSingleByte is called from an internal conversion routine, and occurs when the following routines are executed:
|
Converts the encoded value from UTF-8 to the encoding with the specified name. |
|
|
Converts the specified value from its source encoding to a target encoding using an optional code page. |
Version 3.2 | Generated 2024-02-25 | Home |