encode

Encodes a single code point to a delegate.

This function encodes a single code point into one or more code units. The code units are passed one at a time to the supplied delegate.

The input to this function MUST be a valid code point. This is enforced by the function's in-contract.

The type of the output cannot be deduced. Therefore, it is necessary to explicitly specify the encoding as a template parameter.

Supersedes: This function supersedes std.utf.encode(), however, note that the function codeUnits() supersedes it more conveniently.

  1. E[] encode(dchar c)
  2. size_t encode(dchar c, E[] array)
  3. void encode(dchar c, void delegate(E) dg)
    void
    encode
    (
    E
    )
    (
    dchar c
    ,
    void delegate
    (
    E
    )
    dg
    )
  4. size_t encode(Src[] s, R range)

Parameters

c dchar

the code point to be encoded

dg void delegate
(
E
)

the delegate to invoke for each code unit

Meta

Standards

Unicode 5.0, ASCII, ISO-8859-1, ISO-8859-2, WINDOWS-1250, WINDOWS-1251, WINDOWS-1252