diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-08 16:55:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-08 16:55:03 (GMT) |
commit | 743e03cf5e6eb1b9679f21e613513de51f874878 (patch) | |
tree | 0f4eb4070d0d4a28ad38f4f9031721b8d8609495 /generic/tclEncoding.c | |
parent | d8fd9552b555513cd62d8be2ae422a92c7be9d0e (diff) | |
parent | 39bf69006a6847b4068bd3b9b8debda81197502a (diff) | |
download | tcl-743e03cf5e6eb1b9679f21e613513de51f874878.zip tcl-743e03cf5e6eb1b9679f21e613513de51f874878.tar.gz tcl-743e03cf5e6eb1b9679f21e613513de51f874878.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r-- | generic/tclEncoding.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index ae3e011..1bed847 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -622,13 +622,13 @@ TclInitEncodingSubsystem(void) type.freeProc = NULL; type.nullSize = 2; type.encodingName = "utf-16le"; - type.clientData = INT2PTR(1);; + type.clientData = INT2PTR(1); Tcl_CreateEncoding(&type); type.encodingName = "utf-16be"; type.clientData = INT2PTR(0); Tcl_CreateEncoding(&type); type.encodingName = "utf-16"; - type.clientData = INT2PTR(isLe.c);; + type.clientData = INT2PTR(isLe.c); Tcl_CreateEncoding(&type); #ifndef TCL_NO_DEPRECATED @@ -2414,13 +2414,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); |