summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.h2
-rw-r--r--tests/string.test9
2 files changed, 8 insertions, 3 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 51bd4aa..369a894 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2120,7 +2120,7 @@ typedef struct Tcl_EncodingType {
*/
#ifndef TCL_UTF_MAX
-#define TCL_UTF_MAX 4
+#define TCL_UTF_MAX 3
#endif
/*
diff --git a/tests/string.test b/tests/string.test
index 420b996..781c0bc 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -1930,10 +1930,15 @@ test string-22.12.$noComp {string wordstart, unicode} -body {
test string-22.13.$noComp {string wordstart, unicode} -body {
run {string wordstart "\uC700\uC700 abc" 8}
} -result 3
-test string-22.14.$noComp {string wordstart, unicode} -body {
+test string-22.14.$noComp {string wordstart, invalid UTF-8} -constraints testbytestring -body {
+ # See Bug c61818e4c9
+ set demo [testbytestring "abc def\xE0\xA9ghi"]
+ run {string index $demo [string wordstart $demo 10]}
+} -result g
+test string-22.15.$noComp {string wordstart, unicode} -body {
run {string wordstart "\U1D7CA\U1D7CA abc" 0}
} -result 0
-test string-22.15.$noComp {string wordstart, unicode} -constraints tip389 -body {
+test string-22.16.$noComp {string wordstart, unicode} -constraints tip389 -body {
run {string wordstart "\U1D7CA\U1D7CA abc" 10}
} -result 5