ConvertToUtf32 Method (Char, Char)
Collapse the table of content
Expand the table of content

Char.ConvertToUtf32 Method (Char, Char)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the value of a UTF-16 encoded surrogate pair into a Unicode code point.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static int ConvertToUtf32(
	char highSurrogate,
	char lowSurrogate


Type: System.Char
A high surrogate code unit (that is, a code unit ranging from U+D800 through U+DBFF).
Type: System.Char
A low surrogate code unit (that is, a code unit ranging from U+DC00 through U+DFFF).

Return Value

Type: System.Int32
The 21-bit Unicode code point represented by the highSurrogate and lowSurrogate parameters.


highSurrogate is not in the range U+D800 through U+DBFF, or lowSurrogate is not in the range U+DC00 through U+DFFF.

Use this method to convert a surrogate pair into a 21-bit Unicode code point.

Ordinarily, UTF-16 encoding represents a single Unicode character as a 16-bit code unit. However, it also supports surrogate pairs, which allow a single abstract character to be represented as two 16-bit code units. These two Char objects must have code units that range from U+D800 to U+DBFF for the first (high) surrogate and from U+DC00 to U+DFFF for the second (low) surrogate. Surrogate pairs are supported only by UTF-16 encoding.

The following code example demonstrates the ConvertToUtf32 and ConvertFromUtf32 methods.

Windows Phone OS

Supported in: 8.1, 8.0

© 2017 Microsoft