summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2024-08-21 12:06:34 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2024-08-21 12:06:34 (GMT)
commitc2fab9a915fccf8f4fa9f6f4b41c06332d8bedbf (patch)
treed8d15ac58ad75266481d143473a0c9ab00f280a7
parent418c19eafc40c4df10864e5c3e6792bafe676501 (diff)
downloadtcl-c2fab9a915fccf8f4fa9f6f4b41c06332d8bedbf.zip
tcl-c2fab9a915fccf8f4fa9f6f4b41c06332d8bedbf.tar.gz
tcl-c2fab9a915fccf8f4fa9f6f4b41c06332d8bedbf.tar.bz2
Start on bug [945d2387d7]
-rw-r--r--generic/tclEncoding.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 64fb1b6..95acfa9 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2943,6 +2943,9 @@ Utf16ToUtfProc(
*dst++ = (ch & 0xFF);
} else if (HIGH_SURROGATE(prev) || HIGH_SURROGATE(ch)) {
dst += Tcl_UniCharToUtf(ch | TCL_COMBINE, dst);
+ if (HIGH_SURROGATE(prev) && LOW_SURROGATE(ch)) {
+ --numChars; /* Character has been combined, so compensage count */
+ }
} else if (LOW_SURROGATE(ch) && !PROFILE_TCL8(flags)) {
/* Lo surrogate not preceded by Hi surrogate and not tcl8 profile */
if (PROFILE_STRICT(flags)) {