UrlDecoder.hex4

Converts hex, which is expected to contain a 4-digit ASCII hexadecimal number, into its corresponding UTF-8 character sequence.

class UrlDecoder
static
hex4
out (utf8) { assert (utf8_buf.ptr is utf8.ptr); }

Parameters

hex cstring

character code in hexadecimal representation (ASCII)

utf8_buf mstring

destination buffer for the UTF-8 sequence of the character; the length must be at least 6; may contain tailing junk if the sequence is actually shorter

Return Value

Type: mstring

the UTF-8 sequence (slices the valid data in utf8_buf) on success or an empty string on failure.

In: - hex.length must be 4, - utf8_buf.length must at least be 6.

Out: The returned string slices utf8_buf from the beginning.

Meta