12#include <FL/fl_utf8.h>
14#include "../dlib/dlib.h"
30 if (str && *str && (str[i] & 0x80)) {
31 int internal_bytes = (str[i] & 0x40) ? 0 : 1;
33 while (((str[i + 1] & 0xc0) == 0x80) && (++internal_bytes < 4))
48 return fl_utf8decode(str, end, len);
56 return fl_utf8encode(ucs, buf);
66 return fl_utf8test(src, srclen);
84 if (unicode >= 0x2e80 &&
85 ((unicode <= 0xa4cf) ||
86 (unicode >= 0xf900 && unicode <= 0xfaff) ||
87 (unicode >= 0xff00 && unicode <= 0xff9f))) {
98 return ((unicode >= 0x0300 && unicode <= 0x036f) ||
99 (unicode >= 0x1dc0 && unicode <= 0x1dff) ||
100 (unicode >= 0x20d0 && unicode <= 0x20ff) ||
101 (unicode >= 0xfe20 && unicode <= 0xfe2f));
106 return fl_utf_nb_char((
const uchar_t*)str, len);
uint_t a_Utf8_decode(const char *str, const char *end, int *len)
Decode a single UTF-8-encoded character starting at p.
bool_t a_Utf8_ideographic(const char *s, const char *end, int *len)
Does s point to a UTF-8-encoded ideographic character?.
int a_Utf8_char_count(const char *str, int len)
int a_Utf8_test(const char *src, unsigned int srclen)
Examine first srclen bytes of src.
uint_t a_Utf8_end_of_char(const char *str, uint_t i)
Return index of the last byte of the UTF-8-encoded character that str + i points to or into.
int a_Utf8_encode(unsigned int ucs, char *buf)
Write UTF-8 encoding of ucs into buf and return number of bytes written.
bool_t a_Utf8_combining_char(int unicode)