diff options
Diffstat (limited to 'firmware/include/rbunicode.h')
-rw-r--r-- | firmware/include/rbunicode.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/firmware/include/rbunicode.h b/firmware/include/rbunicode.h new file mode 100644 index 0000000000..1d4bc43096 --- /dev/null +++ b/firmware/include/rbunicode.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* Some conversion functions for handling UTF-8 | ||
2 | * | ||
3 | * copyright Marcoen Hirschberg (2004,2005) | ||
4 | * | ||
5 | * I got all the info from: | ||
6 | * http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 | ||
7 | * and | ||
8 | * http://en.wikipedia.org/wiki/Unicode | ||
9 | */ | ||
10 | |||
11 | #define CODEPAGE_DIR "/.rockbox/codepages" | ||
12 | |||
13 | #define MAX_CP_TABLE_SIZE 32768 | ||
14 | |||
15 | #define MASK 0xC0 /* 11000000 */ | ||
16 | #define COMP 0x80 /* 10x */ | ||
17 | |||
18 | extern int codepage; | ||
19 | |||
20 | /* Encode a UCS value as UTF-8 and return a pointer after this UTF-8 char. */ | ||
21 | unsigned char* utf8encode(unsigned long ucs, unsigned char *utf8); | ||
22 | unsigned char* iso_decode(const unsigned char *latin1, unsigned char *utf8, int cp, int count); | ||
23 | unsigned char* utf16LEdecode(const unsigned char *utf16, unsigned char *utf8, unsigned int count); | ||
24 | unsigned char* utf16BEdecode(const unsigned char *utf16, unsigned char *utf8, unsigned int count); | ||
25 | unsigned char* utf16decode(const unsigned char *utf16, unsigned char *utf8, unsigned int count); | ||
26 | unsigned long utf8length(const unsigned char *utf8); | ||
27 | const unsigned char* utf8decode(const unsigned char *utf8, unsigned short *ucs); | ||
28 | void set_codepage(int cp); | ||
29 | int utf8seek(const unsigned char* utf8, int offset); | ||