[Overview][Types][Classes][Procedures and functions][Variables][Index] |
Translates control characters in a UTF-8-encoded string into human readable format.
Source position: lazutf8.pas line 158
function Utf8EscapeControlChars( |
S: string; |
EscapeMode: TEscapeMode = emPascal |
):string; |
S |
|
UTF-8 encoded string with values converted in the routine. |
EscapeMode |
|
Controls the human readable format for escaped characters. |
String with the escaped values for control characters in S.
Utf8EscapeControlChars translates control characters inside a UTF-8-encoded string into human readable format. Characters in the range #0..#31 are converted into the human-readable values for the control characters in the format specified by EscapeMode, including:
Utf8EscapeControlChars calls FindInvalidUTF8Codepoint to see if S contains any invalid codepoints for the UTF-8 encoding. UTF8FixBroken is called to repair the input value.
Utf8EscapeControlChars iterates over the characters in S, and converts any character value in the eligible range using an internal lookup table for the value in EscapeMode. All other character values (or values in multi-byte UTF-8 code points) are included in the return value in their unmodified form.
Mainly used as a diagnostic or logging tool.
|
Replaces all invalid UTF-8 characters with spaces. |
|
|
Represents styles used to escape control characters. |
Version 3.2 | Generated 2024-02-25 | Home |