[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LConvEncoding' (#lazutils)

UTF8ToKOI8RU

Converts a string from UTF-8 encoding to KOI8-RU encoding.

Declaration

Source position: lconvencoding.pas line 199

function UTF8ToKOI8RU(

  const s: string;

  SetTargetCodePage: Boolean = False

):RawByteString;

Arguments

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.

Function result

String value after conversion to KOI8-RU encoding.

Description

UTF8ToKOI8RU is a RawByteString function used to convert a UTF-8-encoded string to the KOI8RU (Russian, Belarusian, Ukranian Cyrillic) encoding.

UTF8ToKOI8RU calls the UTF8ToSingleByte routine using UnicodeToKOI8RU to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because KOI8RU does not have an official code page. The character translation table in UnicodeToKOI8RU is used to convert character values for the encoding. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 0 in the return value.

UTF8ToKOI8RU is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.


Version 3.2 Generated 2024-02-25 Home