[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Converts the specified string value to the UTF-8 encoding.
Source position: lconvencoding.pas line 112
function ConvertEncodingToUTF8( |
const s: string; |
const FromEncoding: string; |
out Encoded: Boolean |
):string; |
s |
|
String with the encoded value converted to UTF-8. |
FromEncoding |
|
Encoding name for the value in s. |
Encoded |
|
True if the result contains a multi-byte encoded value. Always True for conversions to UTF-8. |
Value for the specified string after encoding conversion.
ConvertEncodingToUTF8 converts the encoding for a string value from the specified encoding to UTF-8. The s argument contains the string value converted in the routine.
FromEncoding is a String value with the name for the existing encoding is s. It is normalized in the routine to remove hyphen characters in the encoding name. The value corresponds to the encoding name constants defined in the unit, and is used to determine which routine is called to perform the encoding conversion.
For example, the following is a sample of the encoding names and their corresponding conversion routines:
Encoded is a Boolean output parameter which indicates if a routine was found to perform the requested conversion. Its value is False when a conversion routine was not found for the source encoding in FromEncoding.
ConvertEncodingToUTF8 is used in the implementation of the ConvertEncoding function.
Remark: | Conversions to the UTF-8 encoding will always set the code page for the converted value to CP_UTF8 (65001). In other words, the SetTargetCodePage argument to the ConvertEncoding() function is ignored for conversions to UTF-8. |
|
Converts the specified value from its source encoding to a target encoding using an optional code page. |
|
|
Converts the encoded value from UTF-8 to the encoding with the specified name. |
|
|
Contains the routine used to convert an ANSI string value to UTF-8 encoding. |
|
|
Converts the specified encoding name to lowercase and removes '-' characters. |
|
|
Gets the name for the default text encoding used on the platform or operating system. |
Version 3.2 | Generated 2024-02-25 | Home |