comparison src/utf8.cc @ 1801:719f4bae567c

utf8
author corvid <corvid@lavabit.com>
date Thu, 06 Jan 2011 06:36:39 +0000
parents 328111d18d57
children 3e7e5395f0bc
comparison
equal deleted inserted replaced
1800:e8f95d2c1732 1801:719f4bae567c
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or 8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12 #include <fltk/utf.h> 12 #include <FL/fl_utf8.h>
13 13
14 #include "../dlib/dlib.h" /* TRUE/FALSE */ 14 #include "../dlib/dlib.h" /* TRUE/FALSE */
15 #include "utf8.hh" 15 #include "utf8.hh"
16 16
17 // C++ functions with C linkage ---------------------------------------------- 17 // C++ functions with C linkage ----------------------------------------------
43 * Note that utf8decode(), if given non-UTF-8 data, will interpret 43 * Note that utf8decode(), if given non-UTF-8 data, will interpret
44 * it as ISO-8859-1 or CP1252 if possible. 44 * it as ISO-8859-1 or CP1252 if possible.
45 */ 45 */
46 uint_t a_Utf8_decode(const char* str, const char* end, int* len) 46 uint_t a_Utf8_decode(const char* str, const char* end, int* len)
47 { 47 {
48 return utf8decode(str, end, len); 48 return fl_utf8decode(str, end, len);
49 } 49 }
50 50
51 /* 51 /*
52 * Write UTF-8 encoding of ucs into buf and return number of bytes written. 52 * Write UTF-8 encoding of ucs into buf and return number of bytes written.
53 */ 53 */
54 int a_Utf8_encode(unsigned int ucs, char *buf) 54 int a_Utf8_encode(unsigned int ucs, char *buf)
55 { 55 {
56 return utf8encode(ucs, buf); 56 return fl_utf8encode(ucs, buf);
57 } 57 }
58 58
59 /* 59 /*
60 * Examine first srclen bytes of src. 60 * Examine first srclen bytes of src.
61 * Return 0 if not legal UTF-8, 1 if all ASCII, 2 if all below 0x800, 61 * Return 0 if not legal UTF-8, 1 if all ASCII, 2 if all below 0x800,
62 * 3 if all below 0x10000, and 4 otherwise. 62 * 3 if all below 0x10000, and 4 otherwise.
63 */ 63 */
64 int a_Utf8_test(const char* src, unsigned int srclen) 64 int a_Utf8_test(const char* src, unsigned int srclen)
65 { 65 {
66 return utf8test(src, srclen); 66 return fl_utf8test(src, srclen);
67 } 67 }
68 68
69 /* 69 /*
70 * Does s point to a UTF-8-encoded ideographic character? 70 * Does s point to a UTF-8-encoded ideographic character?
71 * 71 *