diff options
-rw-r--r-- | generic/tclEncoding.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 50afec0..350a13c 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2409,13 +2409,13 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(*chPtr, dst); } else { src += TclUtfToUniChar(src, chPtr); - if ((*chPtr & 0xFC00) == 0xD800) { + if ((*chPtr | 0x3FF) == 0xDBFF) { /* A high surrogate character is detected, handle especially */ Tcl_UniChar low = *chPtr; if (src <= srcEnd-3) { Tcl_UtfToUniChar(src, &low); } - if ((low & 0xFC00) != 0xDC00) { + if ((low | 0x3FF) != 0xDFFF) { *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); *dst++ = (char) ((*chPtr | 0x80) & 0xBF); |