[Overview][Procedures and functions][Index] |
Converts ordinal values for UTF-16 code points in p to its Unicode equivalent.
Source position: lazutf16.pas line 44
function UTF16CharacterToUnicode( |
p: PWideChar; |
out CharLen: Integer |
):Cardinal; |
p |
|
UTF-16 code points examined and converted in the routine. |
CharLen |
|
Number of UTF-16 code points for the converted character. |
Unicode code point for the values in p.
UTF16CharacterToUnicode converts 16-bit values in p to the equivalent Unicode value.
Unpaired surrogates are invalid in any UTFs. These include any value in the range $D800..$DBFF not followed by a value in the range $DC00..$DFFF, or any value in the range $DC00..$DFFF not preceded by a value in the range $D800..$DBFF.
UTF16CharacterToUnicode ensures that ordinal value(s) in the reserved range(s) are converted to the correct Unicode value. CharLen is updated to reflect whether the values in p are a character represented by a single UTF-16 code point (1), or requires 2 code points for the surrogate pair (2). It is set to 0 when p contains an invalid UTF-16 code point.
The return value contains the Cardinal value for the Unicode code point, or 0 when p contains an invalid UTF-16 code point.
Version 3.2 | Generated 2024-02-25 | Home |