Sign in Join
FPDoc Onlineexperiment

UnicodeToUTF8SkipErrors function

In unit LazUTF8

Stores a single Unicode codepoint as a UTF-8-encoded value in the buffer.

Declaration

pascal
function UnicodeToUTF8SkipErrors(CodePoint: Cardinal; Buf: PChar)
: Integer

Arguments

CodePoint

Codepoint (Unicode character) to convert in the function.

Buf

Buffer where the converted value is stored.

Function result

UTF-8-encoded value for the codepoint.

Description

UnicodeToUTF8SkipErrors is a simple and fast function used to write a single Unicode codepoint as a UTF-8-encoded value in Buf. It returns the number of bytes written. It does not append a terminating null (#0) character. It does not check if the codepoint actually exists in Unicode tables. It returns 0 if the codepoint can not be represented as a 1 to 4 byte UTF-8 sequence.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.