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

UTF8ToKOI8U

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

Declaration

Source position: lconvencoding.pas line 198

function UTF8ToKOI8U(

  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-U encoding.

Description

UTF8ToKOI8U is a RawByteString function used to convert a UTF-8-encoded string to the KOI8-U (Russian Ukranian 8-bit) encoding. KOI8R stands for Kod Obmena Informatsiey, 8-bit Ukranian.

For platforms where system code pages are enabled, SetCodePage is called to convert the value to the KOI8-U code page (21866). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.

For other platforms, the UTF8ToSingleByte routine is called using UnicodeToKOI8U to perform character conversions needed for the target encoding.

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


Version 3.2 Generated 2024-02-25 Home