From 2f92315df0eafedcd9c06b98df46e3ce71701cb2 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 2 Apr 2020 21:29:26 +0000 Subject: One more caller conversion that simplifies. There may be other callers of TclUtfToUniChar that would be made more correct or consistent with a similar conversion. --- generic/tclScan.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/generic/tclScan.c b/generic/tclScan.c index 4b9298d..c599797 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -881,14 +881,7 @@ Tcl_ScanObjCmd( * Scan a single Unicode character. */ - offset = TclUtfToUniChar(string, &sch); - i = (int)sch; -#if TCL_UTF_MAX == 4 - if ((sch >= 0xD800) && (offset < 3)) { - offset += TclUtfToUniChar(string+offset, &sch); - i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF); - } -#endif + offset = TclUtfToUCS4(string, &i); string += offset; if (!(flags & SCAN_SUPPRESS)) { objPtr = Tcl_NewIntObj(i); -- cgit v0.12