Sign in Join
FPDoc Onlineexperiment

TCharacter.IsSurrogatePair function

Member of TCharacterpublicIn unit Character

Check if a pair of characters is a set of high/low surrogate characters.

Declaration

pascal
class function IsSurrogatePair(const AHighSurrogate: UnicodeChar; 
 const ALowSurrogate: UnicodeChar)
: Boolean; overload; static
class function IsSurrogatePair(const AString: UnicodeString; 
 AIndex: Integer): Boolean; overload
 ; static

Arguments

AHighSurrogate

High surrogate character in pair.

ALowSurrogate

Low surrogate character in pair.

AString

String containing UTF-16 encoded characters.

AIndex

Index of UTF16 encoded character in AString to be checked.

Function result

True if AHighSurrogate and ALowSurrogate form a valid Unicode surrogate pair.

Description

IsSurrogatePair returns True if AHighSurrogate and ALowSurrogate form a valid Unicode surrogate pair. ( AHighSurrogate is a high surrogate and ALowSurrogate a matching low surrogate) The character can be specified as a UTF16 character AChar or a pair of UTF16 encoded characters starting at position AIndex in string AString.

Errors

If AIndex is not a valid character index in the string AString, an EArgumentOutOfRangeException exception is raised. If the character at that position is not complete, an EArgumentException exception is raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.