[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Converts a string from UTF-8 encoding to Code Page 1251.
Source position: lconvencoding.pas line 183
function UTF8ToCP1251( |
const s: string; |
SetTargetCodePage: Boolean = False |
s |
|
UTF-8-encoded string value converted in the routine. |
SetTargetCodePage |
|
True if the target code page is set in the return value, False if a code page is not used. |
String value after conversion to Code Page 1251.
UTF8ToCP1251 is a RawByteString function used to convert a UTF-8-encoded string to the Code Page 1251 (Cyrillic) encoding.
UTF8ToCP1251 calls the UTF8ToSingleByte routine using UnicodeToCP1251 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#152) to the target code page. The character translation table in UnicodeToCP1251 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1251 in the return value.
UTF8ToCP1251 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
|
Converts the encoded value from UTF-8 to the encoding with the specified name. |
|
|
Converts a UTF-8-encoded string value to a single-bye character set using a conversion function. |
|
Version 3.2 | Generated 2024-02-25 | Home |