]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Allow list texts to include real UTF-8 characters, as documented.
authorBen Schmidt <none@none>
Mon, 26 Sep 2011 00:43:30 +0000 (10:43 +1000)
committerBen Schmidt <none@none>
Mon, 26 Sep 2011 00:43:30 +0000 (10:43 +1000)
ChangeLog
src/unistr.c

index cb15693bade1848589f7529ea5b13841a2e00848..4d8031498053c5517706102c84cbb16530f5ac98 100644 (file)
--- 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
index 8ce30376c62360b77f4bbce6e909870dec2f2f99..5ce48e9e6c7fcbd1fc770e9eba6c4e98b4f43ff1 100644 (file)
@@ -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);
                }
        }