CodePage class

A mapping between bytes and characters.

A code page is a way to map bytes to character. As such, it can only represent 256 different characters.

Inheritance

Constructors

CodePage(String name, String characters)
Creates a code page with the given name and characters.
factory

Properties

decoder CodePageDecoder
Returns the decoder of this, converting from List<int> to String.
final
encoder CodePageEncoder
Returns the encoder from String to List<int>.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
inverted Codec<List<int>, String>
Inverts this.
no setterinherited
name String
Name of the encoding.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(List<int> bytes, {bool allowInvalid = false}) String
Decodes bytes using encoder.convert.
override
decodeStream(Stream<List<int>> byteStream) Future<String>
inherited
encode(String input, {int? invalidCharacter}) Uint8List
Encodes input using encoder.convert.
override
fuse<R>(Codec<List<int>, R> other) Codec<String, R>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](int byte) int
The character associated with a particular byte in this code page.