summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-16 10:23:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-16 10:23:56 (GMT)
commitfd98096770210ed4e5e1ddbf93c7d3860716efcb (patch)
tree1e539e5a259802446c8e6666e6c119188397ae1a /tests
parentedee881fb26816194a320932f55e095b077d0e94 (diff)
downloadtcl-fd98096770210ed4e5e1ddbf93c7d3860716efcb.zip
tcl-fd98096770210ed4e5e1ddbf93c7d3860716efcb.tar.gz
tcl-fd98096770210ed4e5e1ddbf93c7d3860716efcb.tar.bz2
Addendum to [https://core.tcl-lang.org/tips/doc/trunk/tip/601.md|TIP #601]. Add check for characters > U+10FFFF in utf-32. Since utf-8 cannot handle that, either replace it with the replacement character (-nocomplain) or throw an exception (-strict).
Diffstat (limited to 'tests')
-rw-r--r--tests/encoding.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index db70744..19c7cca 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -506,6 +506,12 @@ test encoding-17.7 {UtfToUtf16Proc} -body {
test encoding-17.8 {UtfToUtf16Proc} -body {
encoding convertto -strict utf-16le "\uD8D8"
} -returnCodes error -result {unexpected character at index 0: 'U+00D8D8'}
+test encoding-17.9 {Utf32ToUtfProc} -body {
+ encoding convertfrom -strict utf-32 "\xFF\xFF\xFF\xFF"
+} -returnCodes error -result {unexpected byte sequence starting at index 0: '\xFF'}
+test encoding-17.10 {Utf32ToUtfProc} -body {
+ encoding convertfrom -nocomplain utf-32 "\xFF\xFF\xFF\xFF"
+} -result \uFFFD
test encoding-18.1 {TableToUtfProc} {
} {}