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.EncodingSchemeUtf16Native
EncodingScheme
to handle UTF-16 in native byte order
This scheme recognises the following names
:
"UTF-16LE" (little-endian architecture only)
"UTF-16BE" (big-endian architecture only)
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