summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index f2cf322..fc7f77b 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -991,6 +991,14 @@ TclParseBackslash(
if (readPtr != NULL) {
*readPtr = count;
}
+#if TCL_UTF_MAX >= 4
+ if ((result & 0xFC00) == 0xD800) {
+ dst[2] = (char) ((result | 0x80) & 0xBF);
+ dst[1] = (char) (((result >> 6) | 0x80) & 0xBF);
+ dst[0] = (char) ((result >> 12) | 0xE0);
+ return 3;
+ }
+#endif
return Tcl_UniCharToUtf(result, dst);
}