View source code
Display the source code in std/encoding.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Class std.encoding.EncodingSchemeUtf8

EncodingScheme to handle UTF-8

class EncodingSchemeUtf8
  : EncodingScheme ;

This scheme recognises the following names: "UTF-8"

Properties

NameTypeDescription
replacementSequence[get] immutable(ubyte)[]Returns the sequence of ubytes to be used to represent any character which cannot be represented in the encoding scheme.

Methods

NameDescription
canEncode Returns true if the character c can be represented in this encoding scheme.
count Returns the total number of code points encoded in a ubyte array.
create Obtains a subclass of EncodingScheme which is capable of encoding and decoding the named encoding scheme.
decode Decodes a single code point.
encode Encodes a single code point into a user-supplied, fixed-size buffer.
encodedLength Returns the number of ubytes required to encode this code point.
factory Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
firstSequence Returns the length of the first encoded sequence.
index Returns the array index at which the (n+1)th code point begins.
isValid Returns true if the array is encoded correctly
names Returns an array of all known names for this encoding scheme
opCmp Compare with another Object obj.
opEquals Test whether this is equal to o. The default implementation only compares by identity (using the is operator). Generally, overrides for opEquals should attempt to compare objects by their contents.
register Registers a subclass of EncodingScheme.
safeDecode Decodes a single code point. The input does not have to be valid.
sanitize Sanitizes an array by replacing malformed ubyte sequences with valid ubyte sequences. The result is guaranteed to be valid for this encoding scheme.
toHash Compute hash function for Object.
toString Returns the standard name of the encoding scheme
toString Convert Object to a human readable string.
validLength Returns the length of the longest possible substring, starting from the first element, which is validly encoded.

Authors

Janice Caron

License

Boost License 1.0.