std1.0.0-beta-7 SafeC docs

std :: encoding::utf8

Function std::utf8_decode

#include <std/encoding/utf8.h> source ยท definition

int utf8_decode(const &char s, unsigned long pos, &unsigned int cp_out)

Decodes one codepoint starting at 's[pos]'. On success, writes the codepoint to '*cp_out' and returns the number of bytes consumed (1-4). On a malformed sequence (bad continuation byte, overlong encoding, encoded surrogate, or truncated multi-byte sequence at a NUL/end-of-buffer), returns 0 and '*cp_out' is unspecified.