[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Converts a string with single-byte values to UTF-8 using a character translation array.
Source position: lconvencoding.pas line 164
function SingleByteToUTF8( |
const s: string; |
const Table: TCharToUTF8Table |
):string; |
s |
|
String with the single-byte values converted in the routine. |
Table |
|
Table with Character to PChar mappings for the converted value. |
String with the UTF-8-encoded value, or an empty string.
s is the string, in its single-byte encoding, with the character values converted in the routine.
Table is a TCharToUTF8Table type and contains an array with the multi-byte values for each of the character using the UTF-8 encoding. The array has 256 elements representing #0 and each of the decimal values in the single byte character set, and may contain 1-4 byte values as needed for the UTF-8 encoding.
SingleByteToUTF8 iterates over the character values in s, and converts each single-byte character to the multi-byte value at the corresponding ordinal position in Table. If s is an empty string (''), the return value is also an empty string.
The return value is cast to a RawByteString type, and its code page is set to CP_UTF8 (65001).
|
Alias for the TCharToUTF8Table type in CodepagesCommon.pas. |
|
|
Provides a mapping for ISO-8859-1 characters to UTF-8 codepoints. |
|
|
Provides a mapping for ISO-8859-2 characters to UTF-8 codepoints. |
|
|
Provides a mapping for ISO-8859-15 characters to UTF-8 codepoints. |
|
|
Provides a mapping for ISO-8859-15 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1250 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1251 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1252 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1253 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1254 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1255 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1255 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 1257 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 437 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 850 characters to UTF-8 codepoints. |
|
|
Provides a mapping for Code Page 866 characters to UTF-8 codepoints. |
|
|
Provides a mapping for KOI8-R characters to UTF-8 codepoints. |
|
|
Provides a mapping for KOI8-U characters to UTF-8 codepoints. |
|
|
Provides mappings for Apple macOS encoding to UTF-8 encoding. |
Version 3.2 | Generated 2024-02-25 | Home |