diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-22 14:31:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-22 14:31:26 (GMT) |
commit | 021af90722d6cf901b75e8f36f0d6cf0a62ed56e (patch) | |
tree | 210b8a5ec1f4880f7174f9fa3f59c93e14544f3b /generic/tclIOUtil.c | |
parent | d970d6f3f67a50a0b71ef5d61f77c9353a09ef64 (diff) | |
parent | be83197ee590ec252235b5684a13f8d42e35c814 (diff) | |
download | tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.zip tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.tar.gz tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 3591431..fcce215 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx( * Tilde-substitution is performed on this * pathname. */ const char *encodingName) /* Either the name of an encoding or NULL to - use the system encoding. */ + use the utf-8 encoding. */ { int length, result = TCL_ERROR; Tcl_StatBuf statBuf; @@ -1722,16 +1722,16 @@ Tcl_FSEvalFileEx( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. If the encoding is unknown report an error. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_Close(interp,chan); - return result; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_Close(interp,chan); + return result; } TclNewObj(objPtr); @@ -1821,7 +1821,7 @@ TclNREvalFile( * evaluate. Tilde-substitution is performed on * this pathname. */ const char *encodingName) /* The name of an encoding to use, or NULL to - * use the system encoding. */ + * use the utf-8 encoding. */ { Tcl_StatBuf statBuf; Tcl_Obj *oldScriptFile, *objPtr; @@ -1858,16 +1858,16 @@ TclNREvalFile( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. If the encoding is unknown report an error. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_Close(interp,chan); - return TCL_ERROR; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_Close(interp, chan); + return TCL_ERROR; } TclNewObj(objPtr); |