From f0800555067a88f3f16b15ce5f99a77c506c589b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 24 Mar 2019 16:43:41 +0000 Subject: Since only bytes 0xF0 - 0xF4 can be the first byte of a valid 4-byte UTF-8 byte sequence, account for that in Tcl_UtfCharComplete(). Only effective when TCL_UTF_MAX>3 --- generic/tclUtf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 1ef35a6..34fcdb5 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -69,11 +69,11 @@ static CONST unsigned char totalBytes[256] = { 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, #if TCL_UTF_MAX > 3 - 4,4,4,4,4,4,4,4, + 4,4,4,4,4, #else - 1,1,1,1,1,1,1,1, + 1,1,1,1,1, #endif - 1,1,1,1,1,1,1,1 + 1,1,1,1,1,1,1,1,1,1,1 }; /* -- cgit v0.12