Char.ConvertFromUtf32 Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Converts the specified Unicode code point into a UTF-16 encoded string.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- utf32
- Type: System.Int32
A 21-bit Unicode code point.
Return Value
Type: System.StringA string consisting of one Char object or a surrogate pair of Char objects equivalent to the code point specified by the utf32 parameter.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | utf32 is not a valid 21-bit Unicode code point ranging from U+0 through U+10FFFF, excluding the surrogate pair range from U+D800 through U+DFFF. |
Use this method to convert a 21-bit Unicode code point to a UTF-16 encoded string before testing the string with methods such as IsLowSurrogate(Char) and IsHighSurrogate(Char).
A valid code point outside the Basic Multilingual Plane (BMP) always yields a valid surrogate pair. However, a valid code point within the BMP might not yield a valid result according to the Unicode standard because no linguistic processing is used in the conversion.
The following code example demonstrates the ConvertToUtf32 and ConvertFromUtf32 methods.