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

UTF8CharacterToUnicode (deprecated)

Returns the codepoint at p and the number of bytes to skip.

Declaration

Source position: lazutf8.pas line 89

function UTF8CharacterToUnicode(

  p: PChar;

  out CharLen: Integer

):Cardinal;

Description

Remark: Deprecated. Use Use UTF8CodepointToUnicode instead.

If p=nil then CharLen and result are 0 otherwise CharLen>0. If there is an encoding error the Result is 0 and CharLen=1 to skip forward. It is safe to do:

var
  s: string;
  p:=1;
while p <= length(s) do
begin
  UTF8CharacterToUnicode(@s[p], CharLen);
  inc(p, CharLen);
end;

For speed reasons, this function only checks for 1, 2, 3, or 4 byte encoding errors. It does not check whether the codepoint is defined in the Unicode table.


Version 3.2 Generated 2024-02-25 Home