UnicodeCharacters.GetCodepointFromSurrogatePair | getCodepointFromSurrogatePair method
Returns the supplementary Unicode character for the specified high and low surrogate pair.
var number = Windows.Data.Text.UnicodeCharacters.getCodepointFromSurrogatePair(highSurrogate, lowSurrogate);
The high surrogate value. This must be in the proper range: 0xD800 <= highSurrogate <= 0xDBFF.
The low surrogate value. This must be in the proper range: 0xDC00 <= lowSurrogate <= 0xDFFF.
The supplementary Unicode character.
Use GetCodepointFromSurrogatePair to prepare Unicode characters before you pass them to other methods of the UnicodeCharacters class, to properly process supplementary characters. See Surrogates and Supplementary Characters for a discussion of supplementary Unicode characters.
The normal procedure for processing the code points in a stream is to:
- Use IsHighSurrogate to determine if a code point is a high surrogate.
- If it is not, pass it to the desired method of UnicodeCharacters.
- Else the code point is a high surrogate:
- Use IsLowSurrogate to check the next code point in the stream to determine if it is a low surrogate.
- If it is not, you have an invalid sequence of code points.
- Else the second code point is a low surrogate. Pass the high and low pair to GetCodepointFromSurrogatePair to obtain the supplementary Unicode character that can be passed on to the desired method.
GetCodepointFromSurrogatePair throws an invalid argument exception if the input is not a valid surrogate pair.
Minimum supported client
Minimum supported server
|Windows Server 2012 R2|
- Surrogates and Supplementary Characters