decode

Decodes a character from a zero-terminated UTF-16 string.

  1. dchar decode(cstring str, ref size_t index)
  2. dchar decode(ref cchar* ref_p, cchar* end)
  3. dchar decode(cwstring str, ref size_t index)
  4. dchar decode(ref cwchar* p, cwchar* end)
  5. dchar decode(ref cwchar* p)
    dchar
    decode
    (
    ref cwchar* p
    )
    in { assert (p && *p, "p is null or at the end of the string"); }
    out (c) { assert (isValidChar(c) || c == ERROR_CHAR); }

Parameters

p
Type: cwchar*

Start of the UTF-16 sequence.

Return Value

Type: dchar

ERROR_CHAR in case of an error in the sequence.

Meta