From: Ben Schmidt Date: Mon, 26 Sep 2011 00:43:30 +0000 (+1000) Subject: Allow list texts to include real UTF-8 characters, as documented. X-Git-Tag: RELEASE_1_2_18a1~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41992322845c00b394e33c2346f5bd3dee1d238f;p=thirdparty%2Fmlmmj.git Allow list texts to include real UTF-8 characters, as documented. --- diff --git a/ChangeLog b/ChangeLog index cb15693b..4d803149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + o Allow list texts to include real UTF-8 characters, as documented o Fix bug where the normal listtext would be sent when unsubscribing from the nomail version of the list o New listtext naming scheme diff --git a/src/unistr.c b/src/unistr.c index 8ce30376..5ce48e9e 100644 --- a/src/unistr.c +++ b/src/unistr.c @@ -530,6 +530,7 @@ char *unistr_escaped_to_utf8(char *str) unistr *us; char *ret; char u[5]; + int len; us = unistr_new(); @@ -562,8 +563,15 @@ char *unistr_escaped_to_utf8(char *str) continue; } } else { - unistr_append_usascii(us, str, 1); + u[0] = *str; + len = 1; str++; + while (*str && (unsigned char)u[0] > 0x7F) { + u[0] = *str; + len++; + str++; + } + unistr_append_utf8(us, str - len, len); } }