Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
utf8.hh
Go to the documentation of this file.
1#ifndef __UTF8_HH__
2#define __UTF8_HH__
3
4#ifdef __cplusplus
5extern "C" {
6#endif /* __cplusplus */
7
8
9#include "d_size.h"
10
16static const char utf8_replacement_char[] = "\xEF\xBF\xBD";
17
19static const char utf8_zero_width_space[] = "\xE2\x80\x8B";
20
21uint_t a_Utf8_end_of_char(const char *str, uint_t i);
22uint_t a_Utf8_decode(const char*, const char* end, int* len);
23int a_Utf8_encode(unsigned int ucs, char *buf);
24int a_Utf8_test(const char* src, unsigned int srclen);
25bool_t a_Utf8_ideographic(const char *s, const char *end, int *len);
26bool_t a_Utf8_combining_char(int unicode);
27int a_Utf8_char_count(const char *str, int len);
28
29#ifdef __cplusplus
30}
31#endif /* __cplusplus */
32
33#endif /* __UTF8_HH__ */
34
unsigned int uint_t
Definition d_size.h:20
unsigned char bool_t
Definition d_size.h:21
static const char utf8_replacement_char[]
Unicode replacement character U+FFFD.
Definition utf8.hh:16
bool_t a_Utf8_ideographic(const char *s, const char *end, int *len)
Does s point to a UTF-8-encoded ideographic character?.
Definition utf8.cc:76
int a_Utf8_char_count(const char *str, int len)
Definition utf8.cc:104
uint_t a_Utf8_decode(const char *, const char *end, int *len)
Decode a single UTF-8-encoded character starting at p.
Definition utf8.cc:46
static const char utf8_zero_width_space[]
Unicode zero width space U+200B.
Definition utf8.hh:19
int a_Utf8_test(const char *src, unsigned int srclen)
Examine first srclen bytes of src.
Definition utf8.cc:64
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.
Definition utf8.cc:23
int a_Utf8_encode(unsigned int ucs, char *buf)
Write UTF-8 encoding of ucs into buf and return number of bytes written.
Definition utf8.cc:54
bool_t a_Utf8_combining_char(int unicode)
Definition utf8.cc:96