Remove get_utf8_char/utf16_char_to_utf8 in favour of glib

g_utf8_get_char_validated/g_unichar_to_utf8.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4893 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-11-10 11:59:31 +00:00 committed by exg
commit 7b529aa530
4 changed files with 15 additions and 128 deletions

View file

@ -1,19 +1,12 @@
#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);