diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-04-12 15:16:50 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-04-12 15:16:50 (GMT) |
commit | 4ff3c3cf90b83dde3d417f6aea0e88e8f15009c5 (patch) | |
tree | bfd56dd8eb0beae4bdf1ce4e2238affd798e3f1b | |
parent | acd94364f531568551c8f3f8eca58c27f936675f (diff) | |
download | tcl-4ff3c3cf90b83dde3d417f6aea0e88e8f15009c5.zip tcl-4ff3c3cf90b83dde3d417f6aea0e88e8f15009c5.tar.gz tcl-4ff3c3cf90b83dde3d417f6aea0e88e8f15009c5.tar.bz2 |
Add lot's of "-encoding utf-8" to our own "source" commands: We are becoming more independant from the system encoding.
-rw-r--r-- | library/auto.tcl | 4 | ||||
-rw-r--r-- | library/init.tcl | 2 | ||||
-rw-r--r-- | library/msgcat/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | library/opt/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | library/package.tcl | 8 | ||||
-rw-r--r-- | library/platform/pkgIndex.tcl | 4 | ||||
-rw-r--r-- | library/platform/shell.tcl | 4 | ||||
-rw-r--r-- | library/safe.tcl | 4 | ||||
-rw-r--r-- | library/tcltest/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | library/tcltest/tcltest.tcl | 4 | ||||
-rw-r--r-- | tests-perf/chan.perf.tcl | 2 | ||||
-rw-r--r-- | tests-perf/clock.perf.tcl | 2 | ||||
-rw-r--r-- | tests-perf/list.perf.tcl | 2 | ||||
-rw-r--r-- | tests-perf/timer-event.perf.tcl | 2 | ||||
-rw-r--r-- | tests/internals.tcl | 2 | ||||
-rw-r--r-- | tests/pkgIndex.tcl | 2 |
16 files changed, 24 insertions, 24 deletions
diff --git a/library/auto.tcl b/library/auto.tcl index f293a38..dd76c1a 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -141,7 +141,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { # source command, but no file exists command if {[interp issafe] || [file exists $file]} { - if {![catch {uplevel #0 [list source $file]} msg opts]} { + if {![catch {uplevel #0 [list source -encoding utf-8 $file]} msg opts]} { return } append errors "$file: $msg\n" @@ -245,7 +245,7 @@ proc auto_mkindex_old {dir args} { if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} { set procName [lindex [auto_qualify $procName "::"] 0] append index "set [list auto_index($procName)]" - append index " \[list source \[file join \$dir [list $file]\]\]\n" + append index " \[list source -encoding utf-8 \[file join \$dir [list $file]\]\]\n" } } close $f diff --git a/library/init.tcl b/library/init.tcl index e57c5ce..1107381 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -493,7 +493,7 @@ proc auto_load_index {} { set dir [lindex $auto_path $i] set f "" if {$issafe} { - catch {source [file join $dir tclIndex]} + catch {source -encoding utf-8 [file join $dir tclIndex]} } elseif {[catch {set f [open [file join $dir tclIndex]]}]} { continue } else { diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl index 72c5dc0..5a55190 100644 --- a/library/msgcat/pkgIndex.tcl +++ b/library/msgcat/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded msgcat 1.6.1 [list source [file join $dir msgcat.tcl]] +package ifneeded msgcat 1.6.1 [list source -encoding utf-8 [file join $dir msgcat.tcl]] diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index c763a3d..aad00af 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded opt 0.4.9 [list source [file join $dir optparse.tcl]] +package ifneeded opt 0.4.9 [list source -encoding utf-8 [file join $dir optparse.tcl]] diff --git a/library/package.tcl b/library/package.tcl index 4ccc20a..33ee7aa 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -291,7 +291,7 @@ proc pkg_mkIndex {args} { set ::tcl::type load } else { set ::tcl::debug sourcing - source [file join $::tcl::dir $::tcl::file] + source -encoding utf-8 [file join $::tcl::dir $::tcl::file] set ::tcl::type source } @@ -441,7 +441,7 @@ proc tclPkgSetup {dir pkg version files} { if {$type eq "load"} { set auto_index($cmd) [list load [file join $dir $f] $pkg] } else { - set auto_index($cmd) [list source [file join $dir $f]] + set auto_index($cmd) [list source -encoding utf-8 [file join $dir $f]] } } } @@ -491,7 +491,7 @@ proc tclPkgUnknown {name args} { set dir [file dirname $file] if {![info exists procdDirs($dir)]} { try { - source $file + source -encoding utf-8 $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue @@ -509,7 +509,7 @@ proc tclPkgUnknown {name args} { # safe interps usually don't have "file exists", if {([interp issafe] || [file exists $file])} { try { - source $file + source -encoding utf-8 $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl index e7029d0..4526c7e 100644 --- a/library/platform/pkgIndex.tcl +++ b/library/platform/pkgIndex.tcl @@ -1,3 +1,3 @@ -package ifneeded platform 1.0.19 [list source [file join $dir platform.tcl]] -package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]] +package ifneeded platform 1.0.19 [list source -encoding utf-8 [file join $dir platform.tcl]] +package ifneeded platform::shell 1.1.4 [list source -encoding utf-8 [file join $dir shell.tcl]] diff --git a/library/platform/shell.tcl b/library/platform/shell.tcl index 1e43409..60d5b37 100644 --- a/library/platform/shell.tcl +++ b/library/platform/shell.tcl @@ -31,7 +31,7 @@ proc ::platform::shell::generic {shell} { # conflict with this one. lappend code {package forget platform} # Inject our platform package - lappend code [list source $base] + lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::generic]} # And done @@ -56,7 +56,7 @@ proc ::platform::shell::identify {shell} { # conflict with this one. lappend code {package forget platform} # Inject our platform package - lappend code [list source $base] + lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::identify]} # And done diff --git a/library/safe.tcl b/library/safe.tcl index 8c79abd..71c1e67 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -532,14 +532,14 @@ proc ::safe::InterpInit { # other procedures defined: if {[catch {::interp eval $child { - source [file join $tcl_library init.tcl] + source -encoding utf-8 [file join $tcl_library init.tcl] }} msg opt]} { Log $child "can't source init.tcl ($msg)" return -options $opt "can't source init.tcl into slave $child ($msg)" } if {[catch {::interp eval $child { - source [file join $tcl_library tm.tcl] + source -encoding utf-8 [file join $tcl_library tm.tcl] }} msg opt]} { Log $child "can't source tm.tcl ($msg)" return -options $opt "can't source tm.tcl into slave $child ($msg)" diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index 2fff5f4..9f51e64 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded tcltest 2.5.8 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.5.8 [list source -encoding utf-8 [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 12b0976..2fc5838 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2923,7 +2923,7 @@ proc tcltest::runAllTests { {shell ""} } { if {[singleProcess]} { if {[catch { incr numTestFiles - uplevel 1 [list ::source $file] + uplevel 1 [list ::source -encoding utf-8 $file] } msg]} { puts [outputChannel] "Test file error: $msg" # append the name of the test to a list to be reported @@ -3008,7 +3008,7 @@ proc tcltest::runAllTests { {shell ""} } { puts [outputChannel] [string repeat ~ 44] puts [outputChannel] "$dir test began at [eval $timeCmd]\n" - uplevel 1 [list ::source [file join $directory all.tcl]] + uplevel 1 [list ::source -encoding utf-8 [file join $directory all.tcl]] set endTime [eval $timeCmd] puts [outputChannel] "\n$dir test ended at $endTime" diff --git a/tests-perf/chan.perf.tcl b/tests-perf/chan.perf.tcl index 2ef87cb..56acccf 100644 --- a/tests-perf/chan.perf.tcl +++ b/tests-perf/chan.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests-perf/clock.perf.tcl b/tests-perf/clock.perf.tcl index 35fe219..bbfdc67 100644 --- a/tests-perf/clock.perf.tcl +++ b/tests-perf/clock.perf.tcl @@ -22,7 +22,7 @@ if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} ## common test performance framework: if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-TclClock { diff --git a/tests-perf/list.perf.tcl b/tests-perf/list.perf.tcl index 121a922..564fad0 100644 --- a/tests-perf/list.perf.tcl +++ b/tests-perf/list.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests-perf/timer-event.perf.tcl b/tests-perf/timer-event.perf.tcl index f68a56a..8256a0e 100644 --- a/tests-perf/timer-event.perf.tcl +++ b/tests-perf/timer-event.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests/internals.tcl b/tests/internals.tcl index 43cafd5..9c2ead1 100644 --- a/tests/internals.tcl +++ b/tests/internals.tcl @@ -2,7 +2,7 @@ # # Source this file in the related tests to include from tcl-tests: # -# source [file join [file dirname [info script]] internals.tcl] +# source -encoding utf-8 [file join [file dirname [info script]] internals.tcl] # # Copyright (c) 2020 Sergey G. Brester (sebres). # diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl index 9d89277..0f3bf49 100644 --- a/tests/pkgIndex.tcl +++ b/tests/pkgIndex.tcl @@ -1,3 +1,3 @@ #! /usr/bin/env tclsh -package ifneeded tcltests 0.1 [list source $dir/tcltests.tcl] +package ifneeded tcltests 0.1 [list source -encoding utf-8 $dir/tcltests.tcl] |