From 6b2add5e70252c513f506f84cc386f47953df48d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 22 Apr 2013 15:36:32 +0100 Subject: Accept non-characters when validating Unicode Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE (for n in the range 0 to 0x10), U+nFFFF (for n in the same range), and U+FDD0..U+FDEF are valid for interchange, and their presence does not make a string ill-formed. GLib 2.36 made the corresponding change in its definition of UTF-8 as used by g_utf8_validate() and similar functions. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072 Signed-off-by: Simon McVittie --- test/syntax.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/syntax.c b/test/syntax.c index 88db9638..e26b3643 100644 --- a/test/syntax.c +++ b/test/syntax.c @@ -178,12 +178,14 @@ const char * const invalid_single_signatures[] = { const char * const valid_strings[] = { "", - "\xc2\xa9", + "\xc2\xa9", /* UTF-8 (c) symbol */ + "\xef\xbf\xbe", /* U+FFFE is reserved but Corrigendum 9 says it's OK */ NULL }; const char * const invalid_strings[] = { - "\xa9", + "\xa9", /* Latin-1 (c) symbol */ + "\xed\xa0\x80", /* UTF-16 surrogates are not valid in UTF-8 */ NULL }; -- cgit v1.2.3