shared: utf8 - support ucs4 -> utf8

Originally we only supported ucs2, so move the ucs4 version from libsystemd-terminal to shared
and use that everywhere.
This commit is contained in:
Tom Gundersen
2014-12-22 20:26:53 +01:00
parent 856d6e0988
commit 2bb4c7e384
9 changed files with 48 additions and 63 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ static int json_parse_string(const char **p, char **ret) {
if (!GREEDY_REALLOC(s, allocated, n + 4))
return -ENOMEM;
n += utf8_encode_unichar(x, s + n);
n += utf8_encode_unichar(s + n, x);
c += 5;
continue;
} else