# HG changeset patch # User mikael # Date 1112782364 0 # Node ID f937475e9baa48ce38433c9614c293b7b006002b # Parent 7259a61e1a4b983dee91522a67ace2608b849c10 [/trunk] Changeset 64 by mikael * Last fix was not correct (which does not mean this one is...) :-( diff -r 7259a61e1a4b -r f937475e9baa mcabber/src/utf8.c --- a/mcabber/src/utf8.c Wed Apr 06 10:07:59 2005 +0000 +++ b/mcabber/src/utf8.c Wed Apr 06 10:12:44 2005 +0000 @@ -41,19 +41,15 @@ char *utf8_encode(const char *src) { char *ret = calloc(1, (strlen(src) * 2) + 1); - unsigned char *aux = ret; + unsigned char *aux = (unsigned char*)ret; while (*src) { unsigned char ch = *src++; if (ch < 0x80U) { *aux++ = ch; - } else if (ch < 0x800U) { /* if (ch < 0x800) { */ + } else { /* if (ch < 0x800U) { */ *aux++ = 0xc0 | (ch >> 6); *aux++ = 0x80 | (ch & 0x3f); - } else { - *aux++ = 0xe0 | (ch >> 12); - *aux++ = 0x80 | ((ch >> 6) & 0x3f); - *aux++ = 0x80 | (ch & 0x3f); } }