System.Net.WebUtility.ConvertSmpToUtf16 C# (CSharp) Method

ConvertSmpToUtf16() private static method

private static ConvertSmpToUtf16 ( uint smpChar, char &leadingSurrogate, char &trailingSurrogate ) : void
smpChar uint
leadingSurrogate char
trailingSurrogate char
return void
        private static void ConvertSmpToUtf16(uint smpChar, out char leadingSurrogate, out char trailingSurrogate)
        {
            Debug.Assert(UNICODE_PLANE01_START <= smpChar && smpChar <= UNICODE_PLANE16_END);

            int utf32 = (int)(smpChar - UNICODE_PLANE01_START);
            leadingSurrogate = (char)((utf32 / 0x400) + HIGH_SURROGATE_START);
            trailingSurrogate = (char)((utf32 % 0x400) + LOW_SURROGATE_START);
        }