[Overview][Procedures and functions][Index] Reference for unit 'LazUTF16' (#lazutils)

IsUTF16CharValid

Declaration

Source position: lazutf16.pas line 46

function IsUTF16CharValid(

  AChar: WideChar;

  ANextChar: WideChar

):Boolean;

Description

Based on the specification defined by the Unicode consortium, at:

http://unicode.org/faq/utf_bom.html#utf16-7

Q: Are there any 16-bit values that are invalid?

A: Unpaired surrogates are invalid in UTFs. These include any value in the range D800 to DBFF not followed by a value in the range DC00 to DFFF, or any value in the range DC00 to DFFF not preceded by a value in the range D800 to DBFF. [AF]

Use ANextChar = #0 to indicate that there is no next char.