View source code
Display the source code in std/encoding.d from which this page was generated on
github.
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.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Class std.encoding.EncodingSchemeASCII
EncodingScheme
to handle ASCII
This scheme recognises the following names
:
"ANSI_X3.4-1968",
"ANSI_X3.4-1986",
"ASCII",
"IBM367",
"ISO646-US",
"ISO_646.irv:1991", "US-ASCII", "cp367", "csASCII" "iso-ir-6", "us"
Inherits from
-
(base class)EncodingScheme
Properties
Name | Type | Description |
---|---|---|
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
Name | Description |
---|---|
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
|
Returns !=0 if this object does have the same contents as obj.
|
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