summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2022-09-11 13:45:04 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2022-09-11 13:45:04 (GMT)
commit32439d945eea3cc4754f2779090075c16256f18a (patch)
tree0565af014ca996276c452e4a7c5dbe1a189f8ab7 /generic/tclIO.c
parent1c7b977c449451a107b7b06b184689cfc8d066b4 (diff)
downloadtcl-32439d945eea3cc4754f2779090075c16256f18a.zip
tcl-32439d945eea3cc4754f2779090075c16256f18a.tar.gz
tcl-32439d945eea3cc4754f2779090075c16256f18a.tar.bz2
Ticket [6978c01b65]: write not encodable character->report to script level Test io-75.5 now ok.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 5317e30..732e103 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -4356,6 +4356,19 @@ Write(
statePtr->outputEncodingFlags &= ~TCL_ENCODING_START;
+ /*
+ * See io-75.2, TCL bug 6978c01b65.
+ * Check, if an encoding error occured and should be reported to the
+ * script level.
+ * This happens, if a written character may not be represented by the
+ * current output encoding and strict encoding is active.hao_
+ */
+
+ if (result == TCL_CONVERT_UNKNOWN) {
+ Tcl_SetErrno(EILSEQ);
+ return -1;
+ }
+
if ((result != TCL_OK) && (srcRead + dstWrote == 0)) {
/*
* We're reading from invalid/incomplete UTF-8.