aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/system/utf8.h
blob: 7120f1a7fc8c9de3bc891cb228bdf27242ed5351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef MGL_UTF8_H
#define MGL_UTF8_H

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

/*
    Returns false on failure. |decoded_codepoint| is set to |str[0]| if size > 0 and |codepoint_length| is set to 1
*/
bool mgl_utf8_decode(const unsigned char *str, size_t size, uint32_t *decoded_codepoint, size_t *codepoint_length);

#endif /* MGL_UTF8_H */