diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-23 00:09:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-23 00:09:05 (GMT) |
commit | e37308d78c5351b43dcce5448d1642dacc7253c8 (patch) | |
tree | 5204e1649bc80febf15d056c018db98fca204023 /generic/tclIO.c | |
parent | 096106f2028a155be144690925802d5152f2c9eb (diff) | |
parent | b5e5883c33bfb1181ca092358479a4439fa3280b (diff) | |
download | tcl-e37308d78c5351b43dcce5448d1642dacc7253c8.zip tcl-e37308d78c5351b43dcce5448d1642dacc7253c8.tar.gz tcl-e37308d78c5351b43dcce5448d1642dacc7253c8.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 8594aa0..e51ae78 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4408,7 +4408,7 @@ Write( * current output encoding and strict encoding is active. */ - if (result == TCL_CONVERT_UNKNOWN) { + if (result == TCL_CONVERT_UNKNOWN || result == TCL_CONVERT_SYNTAX) { encodingError = 1; result = TCL_OK; } @@ -5460,6 +5460,11 @@ FilterInputBytes( &statePtr->inputEncodingState, dst, spaceLeft, &gsPtr->rawRead, &gsPtr->bytesWrote, &gsPtr->charsWrote); + if (result == TCL_CONVERT_UNKNOWN || result == TCL_CONVERT_SYNTAX) { + SetFlag(statePtr, CHANNEL_ENCODING_ERROR); + result = TCL_OK; + } + /* * Make sure that if we go through 'gets', that we reset the * TCL_ENCODING_START flag still. [Bug #523988] @@ -6288,6 +6293,11 @@ ReadChars( flags, &statePtr->inputEncodingState, dst, dstLimit, &srcRead, &dstDecoded, &numChars); + if (code == TCL_CONVERT_UNKNOWN || code == TCL_CONVERT_SYNTAX) { + SetFlag(statePtr, CHANNEL_ENCODING_ERROR); + code = TCL_OK; + } + /* * Perform the translation transformation in place. Read no more than * the dstDecoded bytes the encoding transformation actually produced. |