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)
commit9589c85462da7e8d01fe0154de892c6d30d92f0d (patch)
tree748e6bc9110e6e510384467e0bddc482b5037aaa /win/tclWin32Dll.c
parent2473a591bfbd5b346e1900e3c1088496b0d17590 (diff)
downloadtcl-9589c85462da7e8d01fe0154de892c6d30d92f0d.zip
tcl-9589c85462da7e8d01fe0154de892c6d30d92f0d.tar.gz
tcl-9589c85462da7e8d01fe0154de892c6d30d92f0d.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));