DGen/SDL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
utf8.h
Go to the documentation of this file.
1 #ifndef UTF8_UTIL_H
2 #define UTF8_UTIL_H
3 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #ifndef USE_UTF8
16 #include <ctype.h>
17 
18 /* No utf-8 support. 1 byte = 1 char */
19 #define utf8_strlen(S, B) ((B) < 0 ? (int)strlen(S) : (B))
20 #define utf8_tounicode(S, CP) (*(CP) = (unsigned char)*(S), 1)
21 #define utf8_index(C, I) (I)
22 #define utf8_charlen(C) 1
23 
24 #else
25 
31 int utf8_fromunicode(char *p, unsigned short uc);
32 
40 int utf8_charlen(int c);
41 
53 int utf8_strlen(const char *str, int bytelen);
54 
63 int utf8_index(const char *str, int charindex);
64 
79 int utf8_tounicode(const char *str, int *uc);
80 
81 #endif
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 
88 
89 #endif