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
View File
@@ -98,6 +98,7 @@ int main(int argc, char *argv[]) {
test_one("{\"foo\" : [true, false]}", JSON_OBJECT_OPEN, JSON_STRING, "foo", JSON_COLON, JSON_ARRAY_OPEN, JSON_BOOLEAN, true, JSON_COMMA, JSON_BOOLEAN, false, JSON_ARRAY_CLOSE, JSON_OBJECT_CLOSE, JSON_END);
test_one("\"\xef\xbf\xbd\"", JSON_STRING, "\xef\xbf\xbd", JSON_END);
test_one("\"\\ufffd\"", JSON_STRING, "\xef\xbf\xbd", JSON_END);
test_one("\"\\uf\"", -EINVAL);
return 0;
}