summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclScan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index ade5f33..1ff83af 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -888,8 +888,8 @@ Tcl_ScanObjCmd(
offset = TclUtfToUniChar(string, &sch);
i = (int)sch;
#if TCL_UTF_MAX == 4
- if (!offset) {
- offset = TclUtfToUniChar(string, &sch);
+ if ((sch >= 0xD800) && (offset < 3)) {
+ offset += TclUtfToUniChar(string+offset, &sch);
i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF);
}
#endif