System.WideStrUtils.UTF8CharLength

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function UTF8CharLength(Lead: AnsiChar): Integer; inline;

C++

extern DELPHI_PACKAGE int __fastcall UTF8CharLength(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 UTF8CharLength 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: UTF8CharLength always returns 1, if the given character is not a valid UTF-8 lead byte.

See Also