decode

Decodes a character from a UTF-16 sequence.

  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)
    dchar
    decode
    (
    cwstring str
    ,
    ref size_t index
    )
    in { assert (str.length && index < str.length, "empty string or reached end"); }
    out (c) { assert (index <= str.length && (isValidChar(c) || c == ERROR_CHAR)); }
  4. dchar decode(ref cwchar* p, cwchar* end)
  5. dchar decode(ref cwchar* p)

Parameters

str
Type: cwstring

The UTF-16 sequence.

index
Type: size_t

Where to start from.

Return Value

Type: dchar

ERROR_CHAR in case of an error in the sequence.

Meta