| [Overview][Types][Procedures and functions][Variables][Index] |
Returns the codepoint at p and the number of bytes to skip.
Source position: lazutf8.pas line 89
function UTF8CharacterToUnicode( |
p: PChar; |
out CharLen: Integer |
):Cardinal; |
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,4 byte encoding errors. Especially it does not check if the codepoint is defined in the unicode table.
| lazarus-ccr.sourceforge.net |