changeset 798:98a5de42afcc

Allow list texts to include real UTF-8 characters, as documented.
author Ben Schmidt
date Mon, 26 Sep 2011 10:43:30 +1000
parents c3ee2bfaeb02
children 0fb11a562397
files ChangeLog src/unistr.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 10 12:23:40 2011 +1000
+++ b/ChangeLog	Mon Sep 26 10:43:30 2011 +1000
@@ -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
--- a/src/unistr.c	Sat Sep 10 12:23:40 2011 +1000
+++ b/src/unistr.c	Mon Sep 26 10:43:30 2011 +1000
@@ -530,6 +530,7 @@
 	unistr *us;
 	char *ret;
 	char u[5];
+	int len;
 
 	us = unistr_new();
 
@@ -562,8 +563,15 @@
 				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);
 		}
 	}