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

UTF8CodepointStrictSize

Gets the number of bytes needed for the UTF-8 codepoint.

Declaration

Source position: lazutf8.pas line 108

function UTF8CodepointStrictSize(

  P: PChar

):Integer;

Arguments

P

  

UTF-8-encoded values to examine.

Function result

Number of bytes needed for the codepoint.

Description

Gets the number of bytes needed for the UTF-8 codepoint in P. The return value contains the number of bytes need for the codepoint (in the range 1..4), or 0 (zero) when P is not assigned or the codepoint is invalid.

Remark: UTF8CodepointStrictSize stops examining the byte values in P when #0 (Decimal 0) is encountered.

Version 3.2 Generated 2024-02-25 Home