diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-22 12:25:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-22 12:25:15 (GMT) |
commit | 3fcb054f917b0642d1ee4ee943c41266e20e3acc (patch) | |
tree | 32ea8bf3155d1b46e7d854376b9b2c72e55f9e07 /library/safe.tcl | |
parent | fb77f1148fc73f9da5350bc2f4681c62a5c3ec6a (diff) | |
parent | 5189ce8eae52823d7fb08321cc10f229b8e80a38 (diff) | |
download | tcl-3fcb054f917b0642d1ee4ee943c41266e20e3acc.zip tcl-3fcb054f917b0642d1ee4ee943c41266e20e3acc.tar.gz tcl-3fcb054f917b0642d1ee4ee943c41266e20e3acc.tar.bz2 |
Merge trunk. Use utf-8 explicitly when reading/writing script files
Diffstat (limited to 'library/safe.tcl')
-rw-r--r-- | library/safe.tcl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index a9bb7f3..7eea772 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -937,7 +937,7 @@ proc ::safe::AliasSource {child args} { } } else { set at 0 - set encoding {} + set encoding utf-8 } if {$argc != 1} { set msg "wrong # args: should be \"source ?-encoding E? fileName\"" @@ -980,10 +980,7 @@ proc ::safe::AliasSource {child args} { set replacementMsg "script error" set code [catch { set f [open $realfile] - fconfigure $f -eofchar \032 - if {$encoding ne ""} { - fconfigure $f -encoding $encoding - } + fconfigure $f -encoding $encoding -eofchar \032 set contents [read $f] close $f ::interp eval $child [list info script $file] |