aboutsummaryrefslogtreecommitdiff
path: root/src/utf8.hh
blob: fd1fb87e5c509371505f56997823597c99b0e240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef __UTF8_HH__
#define __UTF8_HH__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


#include "d_size.h"

/*
 * Unicode replacement character U+FFFD
 * "used to replace an incoming character whose value is unknown or otherwise
 * unrepresentable in Unicode"
 */
static const char utf8_replacement_char[] = "\xEF\xBF\xBD";

uint_t a_Utf8_end_of_char(const char *str, uint_t i);
uint_t a_Utf8_decode(const char*, const char* end, int* len);
int a_Utf8_encode(unsigned int ucs, char *buf);
int a_Utf8_test(const char* src, unsigned int srclen);
bool_t a_Utf8_ideographic(const char *s, const char *end, int *len);
bool_t a_Utf8_combining_char(int unicode);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __UTF8_HH__ */