diff options
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r-- | win/tclWin32Dll.c | 8 |
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)); |