summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-12 10:11:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-12 10:11:55 (GMT)
commited7def524dfb30556426a001410d5b7610e108ec (patch)
treea7d3be3be5996d60c7e526bd007ff12be6c8e575 /generic/tclParse.c
parent5e6c7f02c4fafef5d4e6bb2351f640ee12f4b531 (diff)
parentb9bb8fd5b282207069eb191367f3a67d1daf50d5 (diff)
downloadtcl-ed7def524dfb30556426a001410d5b7610e108ec.zip
tcl-ed7def524dfb30556426a001410d5b7610e108ec.tar.gz
tcl-ed7def524dfb30556426a001410d5b7610e108ec.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 55fd63d..6417514 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -871,18 +871,6 @@ TclParseBackslash(
* No hexdigits -> This is just "u".
*/
result = 'u';
-#if TCL_UTF_MAX < 4
- } else if (((result & 0xFC00) == 0xD800) && (count == 6)
- && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) {
- /* If high surrogate is immediately followed by a low surrogate
- * escape, combine them into one character. */
- int low;
- int count2 = ParseHex(p+7, 4, &low);
- if ((count2 == 4) && ((low & 0xFC00) == 0xDC00)) {
- result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000;
- count += count2 + 2;
- }
-#endif
}
break;
case 'U':
@@ -938,13 +926,13 @@ TclParseBackslash(
*/
if (Tcl_UtfCharComplete(p, numBytes - 1)) {
- count = TclUtfToUCS4(p, &unichar) + 1; /* +1 for '\' */
+ count = Tcl_UtfToUniChar(p, &unichar) + 1; /* +1 for '\' */
} else {
char utfBytes[8];
memcpy(utfBytes, p, numBytes - 1);
utfBytes[numBytes - 1] = '\0';
- count = TclUtfToUCS4(utfBytes, &unichar) + 1;
+ count = Tcl_UtfToUniChar(utfBytes, &unichar) + 1;
}
result = unichar;
break;
@@ -955,12 +943,6 @@ TclParseBackslash(
*readPtr = count;
}
count = Tcl_UniCharToUtf(result, dst);
-#if TCL_UTF_MAX < 4
- if ((result >= 0xD800) && (count < 3)) {
- /* Special case for handling high surrogates. */
- count += Tcl_UniCharToUtf(-1, dst + count);
- }
-#endif
return count;
}