System.Text.Unicode.Utf8Utility
Returns the byte index in utf8Data where the first invalid UTF-8 sequence begins,
or -1 if the buffer contains no invalid sequences. Also outs the isAscii parameter
stating whether all data observed (up to the first invalid sequence or the end of the buffer, whichever
comes first) is ASCII.
public static Byte* GetPointerToFirstInvalidByte(Byte* pInputBuffer, int inputLength, out int utf16CodeUnitCountAdjustment, out int scalarCountAdjustment)
Given an input buffer pInputBuffer of byte length inputLength,
returns a pointer to where the first invalid data appears in pInputBuffer.
public static OperationStatus TranscodeToUtf16(Byte* pInputBuffer, int inputLength, Char* pOutputBuffer, int outputCharsRemaining, out byte pInputBufferRemaining, out char pOutputBufferRemaining)
public static OperationStatus TranscodeToUtf8(Char* pInputBuffer, int inputLength, Byte* pOutputBuffer, int outputBytesRemaining, out char pInputBufferRemaining, out byte pOutputBufferRemaining)