class UTF8Encoding
Represents a UTF-8 encoding of Unicode characters.
public UTF8Encoding( bool encoderShouldEmitUTF8Identifier )
Initializes a new instance of the class. A parameter specifies whether to provide a Unicode byte order mark.
encoderShouldEmitUTF8Identifierto specify that the method returns a Unicode byte order mark; otherwise, .
public UTF8Encoding( bool encoderShouldEmitUTF8Identifier, bool throwOnInvalidBytes )
Initializes a new instance of the class. Parameters specify whether to provide a Unicode byte order mark and whether to throw an exception when an invalid encoding is detected.
encoderShouldEmitUTF8Identifierto specify that the method should return a Unicode byte order mark; otherwise, .throwOnInvalidBytesto throw an exception when an invalid encoding is detected; otherwise, .
public bool Equals( object value )
Determines whether the specified object is equal to the current object.
valueThe object to compare with the current instance.- Returns if is an instance of and is equal to the current object; otherwise, .
public int GetByteCount( char* chars, int count )
Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer.
charsA pointer to the first character to encode.countThe number of characters to encode.- Returns The number of bytes produced by encoding the specified characters.
public int GetByteCount( char[] chars, int index, int count )
Calculates the number of bytes produced by encoding a set of characters from the specified character array.
charsThe character array containing the set of characters to encode.indexThe index of the first character to encode.countThe number of characters to encode.- Returns The number of bytes produced by encoding the specified characters.
public int GetByteCount( string chars )
Calculates the number of bytes produced by encoding the characters in the specified .
charsThe containing the set of characters to encode.- Returns The number of bytes produced by encoding the specified characters.
public int GetBytes( char* chars, int charCount, byte* bytes, int byteCount )
Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer.
charsA pointer to the first character to encode.charCountThe number of characters to encode.bytesA pointer to the location at which to start writing the resulting sequence of bytes.byteCountThe maximum number of bytes to write.- Returns The actual number of bytes written at the location indicated by .
public int GetBytes( char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex )
Encodes a set of characters from the specified character array into the specified byte array.
charsThe character array containing the set of characters to encode.charIndexThe index of the first character to encode.charCountThe number of characters to encode.bytesThe byte array to contain the resulting sequence of bytes.byteIndexThe index at which to start writing the resulting sequence of bytes.- Returns The actual number of bytes written into .
public int GetBytes( string s, int charIndex, int charCount, byte[] bytes, int byteIndex )
Encodes a set of characters from the specified into the specified byte array.
sThe containing the set of characters to encode.charIndexThe index of the first character to encode.charCountThe number of characters to encode.bytesThe byte array to contain the resulting sequence of bytes.byteIndexThe index at which to start writing the resulting sequence of bytes.- Returns The actual number of bytes written into .
public int GetCharCount( byte* bytes, int count )
Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer.
bytesA pointer to the first byte to decode.countThe number of bytes to decode.- Returns The number of characters produced by decoding the specified sequence of bytes.
public int GetCharCount( byte[] bytes, int index, int count )
Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
bytesThe byte array containing the sequence of bytes to decode.indexThe index of the first byte to decode.countThe number of bytes to decode.- Returns The number of characters produced by decoding the specified sequence of bytes.
public int GetChars( byte* bytes, int byteCount, char* chars, int charCount )
Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer.
bytesA pointer to the first byte to decode.byteCountThe number of bytes to decode.charsA pointer to the location at which to start writing the resulting set of characters.charCountThe maximum number of characters to write.- Returns The actual number of characters written at the location indicated by .
public int GetChars( byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex )
Decodes a sequence of bytes from the specified byte array into the specified character array.
bytesThe byte array containing the sequence of bytes to decode.byteIndexThe index of the first byte to decode.byteCountThe number of bytes to decode.charsThe character array to contain the resulting set of characters.charIndexThe index at which to start writing the resulting set of characters.- Returns The actual number of characters written into .
public int GetMaxByteCount( int charCount )
Calculates the maximum number of bytes produced by encoding the specified number of characters.
charCountThe number of characters to encode.- Returns The maximum number of bytes produced by encoding the specified number of characters.
public int GetMaxCharCount( int byteCount )
Calculates the maximum number of characters produced by decoding the specified number of bytes.
byteCountThe number of bytes to decode.- Returns The maximum number of characters produced by decoding the specified number of bytes.
public string GetString( byte[] bytes, int index, int count )
Decodes a range of bytes from a byte array into a string.
bytesThe byte array containing the sequence of bytes to decode.indexThe index of the first byte to decode.countThe number of bytes to decode.- Returns A containing the results of decoding the specified sequence of bytes.
public object Clone( )
😔 No documentation found.
public int GetByteCount( char[] chars )
😔 No documentation found.
public int GetByteCount( string s, int index, int count )
😔 No documentation found.
public UTF8Encoding( )
😔 No documentation found.
public byte[] GetBytes( char[] chars )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public byte[] GetBytes( char[] chars, int index, int count )
😔 No documentation found.
public byte[] GetBytes( string s )
😔 No documentation found.
public byte[] GetBytes( string s, int index, int count )
😔 No documentation found.
public int GetCharCount( byte[] bytes )
😔 No documentation found.
public char[] GetChars( byte[] bytes )
😔 No documentation found.
public char[] GetChars( byte[] bytes, int index, int count )
😔 No documentation found.
public string GetString( byte* bytes, int byteCount )
😔 No documentation found.
public string GetString( ReadOnlySpan<byte> bytes )
😔 No documentation found.
public bool IsReadOnly { get; }
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int CodePage { get; }
😔 No documentation found.
public bool IsAlwaysNormalized( )
😔 No documentation found.
public string GetString( byte[] bytes )
😔 No documentation found.
public bool IsAlwaysNormalized( NormalizationForm form )
😔 No documentation found.
public int WindowsCodePage { get; }
😔 No documentation found.
public bool IsBrowserSave { get; }
😔 No documentation found.
public int GetBytes( ReadOnlySpan<char> chars, Span<byte> bytes )
😔 No documentation found.
public bool TryGetBytes( ReadOnlySpan<char> chars, Span<byte> bytes, ref int bytesWritten )
😔 No documentation found.
public int GetCharCount( ReadOnlySpan<byte> bytes )
😔 No documentation found.
public int GetChars( ReadOnlySpan<byte> bytes, Span<char> chars )
😔 No documentation found.
public bool TryGetChars( ReadOnlySpan<byte> bytes, Span<char> chars, ref int charsWritten )
😔 No documentation found.
public Decoder GetDecoder( )
😔 No documentation found.
public Encoder GetEncoder( )
😔 No documentation found.
public byte[] GetPreamble( )
😔 No documentation found.
public ReadOnlySpan<byte> Preamble { get; }
😔 No documentation found.
public int GetByteCount( ReadOnlySpan<char> chars )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public string BodyName { get; }
😔 No documentation found.
public string EncodingName { get; }
😔 No documentation found.
public string HeaderName { get; }
😔 No documentation found.
public string WebName { get; }
😔 No documentation found.
public bool IsBrowserDisplay { get; }
😔 No documentation found.
public bool IsMailNewsDisplay { get; }
😔 No documentation found.
public bool IsMailNewsSave { get; }
😔 No documentation found.
public bool IsSingleByte { get; }
😔 No documentation found.
public DecoderFallback DecoderFallback { get; set; }
😔 No documentation found.
public EncoderFallback EncoderFallback { get; set; }
😔 No documentation found.