[PATCH 2/2] newlib: testsuite: UTF-8.exp: code points above U+10FFFF are invalid

Bernie Innocenti bernie@codewiz.org
Thu Oct 15 13:33:44 GMT 2026


The UTF-8 decoder rejects sequences decoding to more than U+10FFFF, as
RFC 3629 requires, since a67f77af1 (2009).  That covers the 5- and 6-byte
sequences and the largest 4-byte ones, which the test from 2002 still
expects to decode.

Assisted-by: Claude:claude-opus-5-5 claude-code
Signed-off-by: Bernie Innocenti <bernie@codewiz.org>
---
 newlib/testsuite/newlib.locale/UTF-8.exp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/newlib/testsuite/newlib.locale/UTF-8.exp b/newlib/testsuite/newlib.locale/UTF-8.exp
index 94fcb5f53..4db8eb6f9 100644
--- a/newlib/testsuite/newlib.locale/UTF-8.exp
+++ b/newlib/testsuite/newlib.locale/UTF-8.exp
@@ -24,19 +24,19 @@ set expected_output {
 "* U-00000080"
 "* U-00000800"
 "* U-00010000"
-"* U-00200000"
-"* U-04000000"
+"* Invalid"
+"* Invalid"
 "* U-0000007f"
 "* U-000007ff"
 "* U-0000ffff"
-"* U-001fffff"
-"* U-03ffffff"
-"* U-7fffffff"
+"* Invalid"
+"* Invalid"
+"* Invalid"
 "* U-0000d7ff"
 "* U-0000e000"
 "* U-0000fffd"
 "* U-0010ffff"
-"* U-00110000"
+"* Invalid"
 "* 1 Invalid"
 "* 1 Invalid"
 "* 2 Invalid"
-- 
2.56.0



More information about the Newlib mailing list