Модуль Utf8 Справочный лист

Module for UTF-8 manipulation, encoding and decoding

Постоянные

Этот раздел пуст.

Типы

SHORTCHAR = CHAR8;

Переменные

Done: BOOLEAN;

TRUE on successful operation, FALSE on error

Процедуры

PROCEDURE Decode (VAR in: ARRAY OF SHORTCHAR; VAR out: ARRAY OF CHAR);

Convert UTF-8 string in to a UTF-16 string out

PROCEDURE DecodeChar (VAR s: ARRAY OF CHAR): CHAR;

Converts the first UTF-8-encoded character from s to an UTF-16 character and returns it

PROCEDURE Encode (VAR in: ARRAY OF CHAR; VAR out: ARRAY OF SHORTCHAR);

Converts UTF-16A string in to a UTF-8 string out.

Done is set to TRUE on success and FALSE in case of an error.

PROCEDURE EncodeChar (c: CHAR; VAR s: ARRAY OF SHORTCHAR; VAR len: INTEGER);

Converts a single UTF-16 character c to an UTF-8 string s and puts in len the number of generated bytes

PROCEDURE EncodeEx (VAR in: ARRAY OF CHAR; inLen: INTEGER; VAR out: ARRAY OF SHORTCHAR; VAR outLen: INTEGER);

Converts at most inLen first characters of UTF-16 string in to a UTF-8 string out and sets outLen to the number of parsed UTF-16 characters.

Done is set to TRUE on success and FALSE in case of an error.

PROCEDURE Long (c: SHORTCHAR): CHAR;

Converts a SHORTCHAR value c to a CHAR value and returns it

PROCEDURE Short (c: CHAR): SHORTCHAR;

Converts a CHAR value c to a SHORTCHAR value (may truncate it) and returns it

PROCEDURE ShortChr (n: INTEGER): SHORTCHAR;

Returns a SHORTCHAR character value with the given ordinal value.

This is essentially CHR(n) if it would return a SHORTCHAR.