RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideStrUtils.UTF8CharSize Function

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

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

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.
 

 

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