summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index e1fcad4..59384e1 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -885,9 +885,15 @@ Tcl_ScanObjCmd(
* Scan a single Unicode character.
*/
- string += TclUtfToUniChar(string, &sch);
+ offset = TclUtfToUniChar(string, &sch);
+ i = (int)sch;
+ if (!offset) {
+ offset = Tcl_UtfToUniChar(string, &sch);
+ i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF);
+ }
+ string += offset;
if (!(flags & SCAN_SUPPRESS)) {
- objPtr = Tcl_NewIntObj((int)sch);
+ objPtr = Tcl_NewIntObj(i);
Tcl_IncrRefCount(objPtr);
CLANG_ASSERT(objs);
objs[objIndex++] = objPtr;