[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Converts the encoded value from UTF-8 to the encoding with the specified name.
Source position: lconvencoding.pas line 110
function ConvertEncodingFromUTF8( |
const s: string; |
const ToEncoding: string; |
out Encoded: Boolean; |
SetTargetCodePage: Boolean = False |
):string; |
s |
|
UTF-8-encoded value converted in the routine. |
ToEncoding |
|
Encoding name for the converted value. |
Encoded |
|
True if the return value contains multi-byte encoded values, False if it contains a single-byte ANSI string. |
SetTargetCodePage |
|
True if the code page should be set for the return value, False if a code page is not used. |
String value after conversion to the specified encoding.
The s argument contains the UTF-8-encoded value converted in the routine.
ToEncoding is a String value with the name for the target encoding. 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 target encoding in ToEncoding.
SetTargetCodePage is a Boolean argument which indicates if SetCodePage is called to apply a translated code page for the converted value. The default value for the argument is False, and omits the code page for the return value.
ConvertEncodingFromUTF8 is used in the implementation of the ConvertEncoding function.
|
Converts the specified value from its source encoding to a target encoding using an optional code page. |
|
|
Converts the specified encoding name to lowercase and removes '-' characters. |
|
|
Converts the specified string value to the UTF-8 encoding. |
Version 3.2 | Generated 2024-02-25 | Home |