comparison src/utf8.cc @ 1128:fbe2ce98a4b8

make tab expansion for plain text utf8 aware In discussion with corvid <corvid@lavabit.com>.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 25 May 2009 18:42:24 +0200
parents 94b9265663f6
children cdcb6c1fb148
comparison
equal deleted inserted replaced
1127:65c7e33e4466 1128:fbe2ce98a4b8
34 } 34 }
35 return i; 35 return i;
36 } 36 }
37 37
38 /* 38 /*
39 * Decode a single UTF-8-encoded character starting at p.
40 * The resulting Unicode value (in the range 0-0x10ffff) is returned,
41 * and len is set the the number of bytes in the UTF-8 encoding.
42 */
43 uint_t a_Utf8_decode(const char* str, const char* end, int* len)
44 {
45 return utf8decode(str, end, len);
46 }
47
48 /*
39 * Write UTF-8 encoding of ucs into buf and return number of bytes written. 49 * Write UTF-8 encoding of ucs into buf and return number of bytes written.
40 */ 50 */
41 int a_Utf8_encode(unsigned int ucs, char *buf) 51 int a_Utf8_encode(unsigned int ucs, char *buf)
42 { 52 {
43 return utf8encode(ucs, buf); 53 return utf8encode(ucs, buf);