Table of Contents

Method ToWellFormed

Namespace
SimdUnicode
Assembly
SimdUnicode.dll

ToWellFormed(char*, int, char*)

Copies inputLength UTF-16 code units from pInputBuffer to pOutputBuffer, replacing every lone surrogate by U+FFFD. The two buffers must either be identical (in-place operation) or not overlap.

public static void ToWellFormed(char* pInputBuffer, int inputLength, char* pOutputBuffer)

Parameters

pInputBuffer char*
inputLength int
pOutputBuffer char*

ToWellFormed(ReadOnlySpan<char>, Span<char>)

Copies source to destination, replacing every lone surrogate by U+FFFD. The spans must either start at the same address (in-place operation) or not overlap.

public static void ToWellFormed(ReadOnlySpan<char> source, Span<char> destination)

Parameters

source ReadOnlySpan<char>
destination Span<char>

ToWellFormed(string)

Returns a well-formed copy of input where every lone surrogate is replaced by U+FFFD. If input is already well formed, it is returned as is (no allocation).

public static string ToWellFormed(string input)

Parameters

input string

Returns

string