summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-19 19:38:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-19 19:38:10 (GMT)
commit4482897c2885245cc39968e9f7c7efaf226c9a63 (patch)
tree748e6bc9110e6e510384467e0bddc482b5037aaa /win/tclWin32Dll.c
parent81dbe5c597256a959a798a3bec9dbefb99204a60 (diff)
downloadtcl-4482897c2885245cc39968e9f7c7efaf226c9a63.zip
tcl-4482897c2885245cc39968e9f7c7efaf226c9a63.tar.gz
tcl-4482897c2885245cc39968e9f7c7efaf226c9a63.tar.bz2
Minor optimizations
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index ddfa0d6..c39d2c1 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -567,15 +567,19 @@ Tcl_WinTCharToUtf(
wEnd = (TCHAR *)string + len;
for (w = (TCHAR *)string; w < wEnd; ) {
if (!blen && ((*w & 0xFC00) != 0xDC00)) {
- /* Special case for handling upper surrogates. */
+ /* Special case for handling high surrogates. */
p += Tcl_UniCharToUtf(-1, p);
}
blen = Tcl_UniCharToUtf(*w, p);
p += blen;
+ if ((*w >= 0xD800) && (blen < 3)) {
+ /* Indication that high surrogate is handled */
+ blen = 0;
+ }
w++;
}
if (!blen) {
- /* Special case for handling upper surrogates. */
+ /* Special case for handling high surrogates. */
p += Tcl_UniCharToUtf(-1, p);
}
Tcl_DStringSetLength(dsPtr, oldLength + (p - result));