X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Ffe-common%2Fcore%2Futf8.h;fp=apps%2Firssi%2Fsrc%2Ffe-common%2Fcore%2Futf8.h;h=163f1717ebcaae445cb1e570f239e45b07b8d8f3;hb=18d69a0a1fec438e241bb4f431506ed59a34066b;hp=f9e3e59e920ccf6bedf61b129bcad57ee54eedfd;hpb=f7be6adec0248118cddde9b04522c13cd90568cd;p=silc.git diff --git a/apps/irssi/src/fe-common/core/utf8.h b/apps/irssi/src/fe-common/core/utf8.h index f9e3e59e..163f1717 100644 --- a/apps/irssi/src/fe-common/core/utf8.h +++ b/apps/irssi/src/fe-common/core/utf8.h @@ -1,27 +1,6 @@ #ifndef __UTF8_H #define __UTF8_H -/* Returns -2 = invalid, -1 = need more data, otherwise unichar. */ -int get_utf8_char(const unsigned char **ptr, int len, unichar *chr_r); - -/* Returns length of UTF8 string */ -int strlen_utf8(const char *str); - -/* UTF-8 -> unichar string. The NUL is copied as well. */ -void utf8_to_utf16(const char *str, unichar *out); - -/* unichar -> UTF-8 string. outbuf must be at least 6 chars long. - Returns outbuf string length. */ -int utf16_char_to_utf8(unichar c, char *outbuf); - -/* unichar -> UTF-8 string. The NUL is copied as well. - Make sure out is at least 6 x length of str. */ -void utf16_to_utf8(const unichar *str, char *out); - -/* unichar -> UTF-8 string with position transformed. The NUL is copied as well. - Make sure out is at least 6 x length of str. */ -void utf16_to_utf8_with_pos(const unichar *str, int spos, char *out, int *opos); - /* XXX I didn't check the encoding range of big5+. This is standard big5. */ #define is_big5_los(lo) (0x40 <= (lo) && (lo) <= 0x7E) /* standard */ #define is_big5_lox(lo) (0x80 <= (lo) && (lo) <= 0xFE) /* extended */ @@ -30,6 +9,8 @@ void utf16_to_utf8_with_pos(const unichar *str, int spos, char *out, int *opos); #define is_big5(hi,lo) (is_big5_hi(hi) && is_big5_lo(lo)) /* Returns width for character (0-2). */ -int utf8_width(unichar c); +int mk_wcwidth(unichar c); + +#define unichar_isprint(c) (((c) & ~0x80) >= 32) #endif