diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c index e1f9619c7..ea87c7d1e 100644 --- a/glib/tests/strfuncs.c +++ b/glib/tests/strfuncs.c @@ -731,6 +731,22 @@ test_strcompress_strescape (void) g_assert_cmpstr (str, ==, "abc\\\"\b\f\n\r\t\v\003\177\234\313"); g_free (str); g_free (tmp); + + /* Unicode round trip */ + str = g_strescape ("héllø there⸘", NULL); + g_assert_nonnull (str); + g_assert_cmpstr (str, ==, "h\\303\\251ll\\303\\270 there\\342\\270\\230"); + tmp = g_strcompress (str); + g_assert_nonnull (tmp); + g_assert_cmpstr (tmp, ==, "héllø there⸘"); + g_free (tmp); + g_free (str); + + /* Test expanding invalid escapes */ + str = g_strcompress ("\\11/ \\118 \\8aa \\19"); + g_assert_nonnull (str); + g_assert_cmpstr (str, ==, "\t/ \t8 8aa \0019"); + g_free (str); } /* Testing g_ascii_strcasecmp() and g_ascii_strncasecmp() */ diff --git a/glib/tests/uri.c b/glib/tests/uri.c index 01ca68c26..70cee76e9 100644 --- a/glib/tests/uri.c +++ b/glib/tests/uri.c @@ -382,7 +382,7 @@ test_uri_unescape_bytes (gconstpointer test_data) tests[] = { { "%00%00", NULL, 2, (const guint8 *) "\x00\x00" }, - { "/cursors/none.png", "/", 17, "/cursors/none.png" }, + { "/cursors/none.png", "/", 17, (const guint8 *) "/cursors/none.png" }, { "/cursors%2fbad-subdir/none.png", "/", -1, NULL }, { "%%", NULL, -1, NULL }, { "%", NULL, -1, NULL },