RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideStrUtils.UTF8CharLength Function

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

Pascal
function UTF8CharLength(Lead: AnsiChar): Integer;
C++
int UTF8CharLength(AnsiChar Lead);

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.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!