Partager via


WriteSurrogateCharEntity (Compact 7)

3/12/2014

This method forces the generation of a surrogate character entity for the specified string value.

Syntax

HRESULT WriteSurrogateCharEntity (
    WCHAR lowChar, 
    WCHAR highChar
);

Parameters

  • lowChar
    Low-surrogate for the pair. The code value must be in the range U+DC00 - U+DFFF.
  • highChar
    High-surrogate for the pair. The code value must be in the range U+D800 - U+DBFF.

Return Value

This method returns S_OK if no error is generated.

Remarks

A surrogate pair is defined as character code that consists of a sequence of two Unicode values, where the first value is a high-surrogate and the second value is a low-surrogate. The lowChar and highChar parameters must be a valid surrogate character pair, or an error is returned and the writer does not produce output. The writer writes surrogate pairs in hexadecimal format.

The following code example produces a surrogate pair:

WriteSurrogateCharEntity(L'\uD800', L'\uDC00'));

For more information about how to write surrogate pair characters, see WriteChars.

See Also

Reference

IXmlWriter Methods
WriteChars
IXmlWriter Properties