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 897dbb6..e786a6f 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -866,6 +866,14 @@ TclParseBackslash(
* No hexdigits -> This is just "u".
*/
result = 'u';
+ } else if (((result & 0xDC00) == 0xD800) && (count == 6) && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) {
+ /* If high surrogate is immediately followed by a low surrogate escape, combine them. */
+ int low;
+ int count2 = TclParseHex(p+7, 4, &low);
+ if ((low & 0xDC00) == 0xDC00) {
+ result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000;
+ count += count2 + 2;
+ }
}
break;
case 'U':