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.

Function std.encoding.EncodingScheme.encode

Encodes a single code point into a user-supplied, fixed-size buffer.

abstract ulong encode (
  dchar c,
  ubyte[] buffer
) const;

This function encodes a single code point into one or more ubytes. The supplied buffer must be code unit aligned. (For example, UTF-16LE or UTF-16BE must be wchar-aligned, UTF-32LE or UTF-32BE must be dchar-aligned, etc.)

The input to this function MUST be a valid code point.

Parameters

NameDescription
c the code point to be encoded
buffer the destination array

Returns

the number of ubytes written.

Authors

Janice Caron

License

Boost License 1.0.