Class GSMEncoding
Represents unpacked GSM 03.38 character encoding of Unicode characters.
public class GSMEncoding : Encoding, ICloneable
- Inheritance
-
GSMEncoding
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GSMEncoding()
public GSMEncoding()
GSMEncoding(IGSMCharsetMap)
public GSMEncoding(IGSMCharsetMap charsetMap)
Parameters
charsetMap
IGSMCharsetMap
GSMEncoding(char[], char[])
public GSMEncoding(char[] characterSet, char[] extensionSet)
Parameters
Properties
CharacterSet
public char[] CharacterSet { get; }
Property Value
- char[]
ExtensionSet
public char[] ExtensionSet { get; }
Property Value
- char[]
Methods
GetByteCount(char[], int, int)
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.
public override int GetByteCount(char[] chars, int index, int count)
Parameters
chars
char[]The character array containing the set of characters to encode.
index
intThe index of the first character to encode.
count
intThe number of characters to encode.
Returns
- int
The number of bytes produced by encoding the specified characters.
Exceptions
- ArgumentNullException
chars
is null.- ArgumentOutOfRangeException
index
orcount
is less than zero.-or-index
andcount
do not denote a valid range inchars
.- EncoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
GetBytes(char[], int, int, byte[], int)
When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.
public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
Parameters
chars
char[]The character array containing the set of characters to encode.
charIndex
intThe index of the first character to encode.
charCount
intThe number of characters to encode.
bytes
byte[]The byte array to contain the resulting sequence of bytes.
byteIndex
intThe index at which to start writing the resulting sequence of bytes.
Returns
- int
The actual number of bytes written into
bytes
.
Exceptions
- ArgumentNullException
chars
is null.-or-bytes
is null.- ArgumentOutOfRangeException
charIndex
orcharCount
orbyteIndex
is less than zero.-or-charIndex
andcharCount
do not denote a valid range inchars
.-or-byteIndex
is not a valid index inbytes
.- ArgumentException
bytes
does not have enough capacity frombyteIndex
to the end of the array to accommodate the resulting bytes.- EncoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
GetCharCount(byte[], int, int)
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
public override int GetCharCount(byte[] bytes, int index, int count)
Parameters
bytes
byte[]The byte array containing the sequence of bytes to decode.
index
intThe index of the first byte to decode.
count
intThe number of bytes to decode.
Returns
- int
The number of characters produced by decoding the specified sequence of bytes.
Exceptions
- ArgumentNullException
bytes
is null.- ArgumentOutOfRangeException
index
orcount
is less than zero.-or-index
andcount
do not denote a valid range inbytes
.- DecoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-DecoderFallback is set to DecoderExceptionFallback.
GetChars(byte[], int, int, char[], int)
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.
public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
Parameters
bytes
byte[]The byte array containing the sequence of bytes to decode.
byteIndex
intThe index of the first byte to decode.
byteCount
intThe number of bytes to decode.
chars
char[]The character array to contain the resulting set of characters.
charIndex
intThe index at which to start writing the resulting set of characters.
Returns
- int
The actual number of characters written into
chars
.
Exceptions
- ArgumentNullException
bytes
is null.-or-chars
is null.- ArgumentOutOfRangeException
byteIndex
orbyteCount
orcharIndex
is less than zero.-or-byteindex
andbyteCount
do not denote a valid range inbytes
.-or-charIndex
is not a valid index inchars
.- ArgumentException
chars
does not have enough capacity fromcharIndex
to the end of the array to accommodate the resulting characters.- DecoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-DecoderFallback is set to DecoderExceptionFallback.
GetMaxByteCount(int)
When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.
public override int GetMaxByteCount(int charCount)
Parameters
charCount
intThe number of characters to encode.
Returns
- int
The maximum number of bytes produced by encoding the specified number of characters.
Exceptions
- ArgumentOutOfRangeException
charCount
is less than zero.- EncoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
GetMaxCharCount(int)
When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.
public override int GetMaxCharCount(int byteCount)
Parameters
byteCount
intThe number of bytes to decode.
Returns
- int
The maximum number of characters produced by decoding the specified number of bytes.
Exceptions
- ArgumentOutOfRangeException
byteCount
is less than zero.- DecoderFallbackException
A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-DecoderFallback is set to DecoderExceptionFallback.