System.WideStrUtils.UTF8CharSize

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function UTF8CharSize(Lead: AnsiChar): Integer;

C++

extern DELPHI_PACKAGE int __fastcall UTF8CharSize(char Lead);

Properties

Type Visibility Source Unit Parent
function public
System.WideStrUtils.pas
System.WideStrUtils.hpp
System.WideStrUtils System.WideStrUtils

Description

Returns the number of bytes that follow a lead UTF-8 byte.

Call UTF8CharSize to determine the number of bytes that follow a lead UTF-8 character (including the lead byte).

In UTF-8, each lead character can be followed by a variable number of other characters. This combination of UTF-8 characters is used to encode a single Unicode character.

Note: UTF8CharSize always returns 0, if the given character is not a valid UTF-8 lead byte.

See Also