1 /* Some conversion functions for handling UTF-8
3 * copyright Marcoen Hirschberg (2004,2005)
5 * I got all the info from:
6 * http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
8 * http://en.wikipedia.org/wiki/Unicode
11 #define MASK 0xC0 /* 11000000 */
12 #define COMP 0x80 /* 10x */
15 /* Encode a UCS value as UTF-8 and return a pointer after this UTF-8 char. */
16 unsigned char* utf8encode(unsigned long ucs
, unsigned char *utf8
);
17 unsigned char* iso_decode(const unsigned char *latin1
, unsigned char *utf8
, int cp
, int count
);
18 unsigned char* utf16LEdecode(const unsigned char *utf16
, unsigned char *utf8
, int count
);
19 unsigned char* utf16BEdecode(const unsigned char *utf16
, unsigned char *utf8
, int count
);
20 unsigned long utf8length(const unsigned char *utf8
);
21 const unsigned char* utf8decode(const unsigned char *utf8
, unsigned short *ucs
);
22 void set_codepage(int cp
);
23 int utf8seek(const unsigned char* utf8
, int offset
);