diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-12-20 09:42:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-12-20 09:42:26 (GMT) |
commit | 7561bdb176677ac643786eb846f918403fc872b3 (patch) | |
tree | b213cdd0a448c8d0de28e22f94d9c3f58720b133 /generic | |
parent | d61473e631e6369735cee6487ee47eff5d690a1b (diff) | |
parent | ac4faee2328d37860ec958ec755508713cbf6ea7 (diff) | |
download | tcl-7561bdb176677ac643786eb846f918403fc872b3.zip tcl-7561bdb176677ac643786eb846f918403fc872b3.tar.gz tcl-7561bdb176677ac643786eb846f918403fc872b3.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclEncoding.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 60abb51..23d71ff 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2408,13 +2408,12 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(ch, dst); ch = low; #endif - } else if (STOPONERROR && !(flags & TCL_ENCODING_MODIFIED) && !Tcl_UniCharIsUnicode(ch) - && (((ch & ~0x7FF) == 0xD800) || ((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT))) { + } else if (STOPONERROR && !(flags & TCL_ENCODING_MODIFIED) && (((ch & ~0x7FF) == 0xD800))) { result = TCL_CONVERT_UNKNOWN; src = saveSrc; break; } else if (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT) - && (flags & TCL_ENCODING_MODIFIED) && !Tcl_UniCharIsUnicode(ch)) { + && (flags & TCL_ENCODING_MODIFIED) && ((ch & ~0x7FF) == 0xD800)) { result = TCL_CONVERT_SYNTAX; src = saveSrc; break; @@ -2506,7 +2505,7 @@ Utf32ToUtfProc( ch = (src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF); } if ((unsigned)ch > 0x10FFFF || (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT) - && !Tcl_UniCharIsUnicode(ch))) { + && ((ch & ~0x7FF) == 0xD800))) { if (STOPONERROR) { result = TCL_CONVERT_SYNTAX; break; @@ -2602,7 +2601,7 @@ UtfToUtf32Proc( break; } len = TclUtfToUCS4(src, &ch); - if (!Tcl_UniCharIsUnicode(ch) && (((ch & ~0x7FF) == 0xD800) || ((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT))) { + if ((ch & ~0x7FF) == 0xD800) { if (STOPONERROR) { result = TCL_CONVERT_UNKNOWN; break; @@ -2804,7 +2803,7 @@ UtfToUtf16Proc( break; } len = TclUtfToUCS4(src, &ch); - if (!Tcl_UniCharIsUnicode(ch) && (((ch & ~0x7FF) == 0xD800) || ((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT))) { + if ((ch & ~0x7FF) == 0xD800) { if (STOPONERROR) { result = TCL_CONVERT_UNKNOWN; break; |