PeterO.Text.Normalizer
## PeterO.Text.Normalizer
public sealed class Normalizer
Deprecated. Use NormalizerInput instead; that class is much more flexible than Normalizer.
Implements the Unicode normalization algorithm and contains methods and functionality to test and convert Unicode strings for Unicode normalization.
NOTICE: While this class’s source code is in the public domain, the class uses an internal class, called NormalizationData, that includes data derived from the Unicode Character Database. See the documentation for the NormalizerInput class for the permission notice for the Unicode Character Database.
Member Summary
[IsNormalized(string, PeterO.Text.Normalization)](#IsNormalized_string_PeterO_Text_Normalization)
- Returns whether this string is normalized.[Normalize(string, PeterO.Text.Normalization)](#Normalize_string_PeterO_Text_Normalization)
- Converts a string to the given Unicode normalization form.[Read(int[], int, int)](#Read_int_int_int)
- Reads a sequence of Unicode code points from a data source.[ReadChar()](#ReadChar)
- Reads a Unicode character from a data source.
public Normalizer( string str, PeterO.Text.Normalization form);
Initializes a new instance of the PeterO.Text.Normalizer class.
Parameters:
-
str: The parameter str is a text string.
-
form: The parameter form is a Normalization object.
public static bool IsNormalized( string str, PeterO.Text.Normalization form);
Returns whether this string is normalized.
Parameters:
-
str: The string to check.
-
form: The parameter form is a Normalization object.
Return Value:
true
if this string is normalized; otherwise, false
. Returns false
if the string contains an unpaired surrogate code point.
public static string Normalize( string str, PeterO.Text.Normalization form);
Converts a string to the given Unicode normalization form.
Parameters:
-
str: An arbitrary string.
-
form: The Unicode normalization form to convert to.
Return Value:
The parameter str converted to the given normalization form.
Exceptions:
- System.ArgumentNullException: The parameter str is null.
public int Read( int[] chars, int index, int length);
Reads a sequence of Unicode code points from a data source.
Parameters:
-
chars: Output buffer.
-
index: Index in the output buffer to start writing to.
-
length: Maximum number of code points to write.
Return Value:
The number of Unicode code points read, or 0 if the end of the source is reached.
Exceptions:
-
System.ArgumentException: Either index or length is less than 0 or greater than chars ‘s length, or chars ‘s length minus index is less than length .
-
System.ArgumentNullException: The parameter chars is null.
public int ReadChar();
Reads a Unicode character from a data source.
Return Value:
Either a Unicode code point (from 0-0xd7ff or from 0xe000 to 0x10ffff), or the value -1 indicating the end of the source.