GetCharacterUtf32 method

ITextRange.GetCharacterUtf32 method

Retrieves the Unicode Transformation Format (UTF)-32 character code of the character at the specified offset from the end of the text range.

Syntax


void GetCharacterUtf32(
  out uint value, 
  int offset
)

Parameters

value (out parameter)

Type: System.UInt32 [.NET] | uint32 [C++]

The character value.

offset

Type: System.Int32 [.NET] | int32 [C++]

The offset from the end of the text range.

If offset isThe method returns this character
0The character at the end of the range
in the middle of a surrogate pairThe corresponding UTF-32 character

 

Remarks

This method differs from ITextRange.Character in the following ways:

  • It returns the UTF-32 character code for a UTF-16 surrogate pair instead of the pair’s lead code (see Sections 3.8 and 3.9 and Table 3-5 in The Unicode Standard for explanations of this notation).
  • It gets the code for the character at the specified offset from the end of the text range instead of the character at the start of the range.

If you try to retrieve a character that is before the start of the story or at the end of the story, value is set to the character code 0.

If offset is 0, this method retrieves the character at the end of the range.

If offset is in the middle of a surrogate pair, this method retrieves the corresponding UTF-32 character.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.winmd

See also

ITextRange
ITextRange.Character

 

 

Show:
© 2016 Microsoft