From 438b053136dd5cd156caea00d44e5766c13c0e7d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 16 Apr 2024 11:25:57 +0000 Subject: [PATCH] Add even more "-encoding utf-8" in various places --- pkgIndex.tcl.in | 12 ++++++------ tcl/cmdsrv/cmdsrv.tcl | 4 ++-- tcl/phttpd/phttpd.tcl | 8 ++++---- tcl/phttpd/uhttpd.tcl | 2 +- tcl/tpool/tpool.tcl | 2 +- tests/all.tcl | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkgIndex.tcl.in b/pkgIndex.tcl.in index 2334a976..ce10d478 100755 --- a/pkgIndex.tcl.in +++ b/pkgIndex.tcl.in @@ -33,11 +33,11 @@ if {![package vsatisfies [package provide Tcl] 8.5]} { [list proc @PACKAGE_NAME@_source {dir} { if {[info exists ::env(TCL_THREAD_LIBRARY)] && [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { - source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl + source -encoding utf-8 $::env(TCL_THREAD_LIBRARY)/ttrace.tcl } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { - source [file join $dir .. lib ttrace.tcl] + source -encoding utf-8 [file join $dir .. lib ttrace.tcl] } elseif {[file readable [file join $dir ttrace.tcl]]} { - source [file join $dir ttrace.tcl] + source -encoding utf-8 [file join $dir ttrace.tcl] } if {[namespace which ::ttrace::update] ne ""} { ::ttrace::update @@ -53,11 +53,11 @@ if {![package vsatisfies [package provide Tcl] 8.5]} { package ifneeded Ttrace @PACKAGE_VERSION@ [list ::apply {{dir} { if {[info exists ::env(TCL_THREAD_LIBRARY)] && [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { - source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl + source -encoding utf-8 $::env(TCL_THREAD_LIBRARY)/ttrace.tcl } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { - source [file join $dir .. lib ttrace.tcl] + source -encoding utf-8 [file join $dir .. lib ttrace.tcl] } elseif {[file readable [file join $dir ttrace.tcl]]} { - source [file join $dir ttrace.tcl] + source -encoding utf-8 [file join $dir ttrace.tcl] } if {[namespace which ::ttrace::update] ne ""} { ::ttrace::update diff --git a/tcl/cmdsrv/cmdsrv.tcl b/tcl/cmdsrv/cmdsrv.tcl index f20bc25c..34ec0e84 100644 --- a/tcl/cmdsrv/cmdsrv.tcl +++ b/tcl/cmdsrv/cmdsrv.tcl @@ -14,7 +14,7 @@ # Example: # # # tclsh8.6 -# % source cmdsrv.tcl +# % source -encoding utf-8 cmdsrv.tcl # % cmdsrv::create 5000 -idletime 60 # % vwait forever # @@ -64,7 +64,7 @@ proc cmdsrv::create {port args} { array set data { -idletime 300000 - -initcmd {source cmdsrv.tcl} + -initcmd {source -encoding utf-8 cmdsrv.tcl} } # diff --git a/tcl/phttpd/phttpd.tcl b/tcl/phttpd/phttpd.tcl index 4ad88494..7343d9e7 100644 --- a/tcl/phttpd/phttpd.tcl +++ b/tcl/phttpd/phttpd.tcl @@ -15,7 +15,7 @@ # Example: # # # tclsh8.6 -# % source phttpd.tcl +# % source -encoding utf-8 phttpd.tcl # % phttpd::create 5000 # % vwait forever # @@ -42,7 +42,7 @@ package require Thread 2.5 # if {0} { - eval [set TCL_TPOOL {source ../tpool/tpool.tcl}] + eval [set TCL_TPOOL {source -encoding utf-8 ../tpool/tpool.tcl}] } namespace eval phttpd { @@ -124,12 +124,12 @@ proc phttpd::create {port args} { # # Using the internal C-based thread pool # - set initcmd "source ../phttpd/phttpd.tcl" + set initcmd "source -encoding utf-8 ../phttpd/phttpd.tcl" } else { # # Using the Tcl-level hand-crafted thread pool # - append initcmd "source ../phttpd/phttpd.tcl" \n $::TCL_TPOOL + append initcmd "source -encoding utf-8 ../phttpd/phttpd.tcl" \n $::TCL_TPOOL } set Httpd(tpid) [tpool::create -maxworkers 8 -initcmd $initcmd] diff --git a/tcl/phttpd/uhttpd.tcl b/tcl/phttpd/uhttpd.tcl index 597475c1..07410144 100644 --- a/tcl/phttpd/uhttpd.tcl +++ b/tcl/phttpd/uhttpd.tcl @@ -15,7 +15,7 @@ # Example: # # # tclsh8.6 -# % source uhttpd.tcl +# % source -encoding utf-8 uhttpd.tcl # % uhttpd::create 5000 # % vwait forever # diff --git a/tcl/tpool/tpool.tcl b/tcl/tpool/tpool.tcl index 021e2313..91b725cd 100644 --- a/tcl/tpool/tpool.tcl +++ b/tcl/tpool/tpool.tcl @@ -107,7 +107,7 @@ proc tpool::create {args} { -exitcmd "" } - tsv::set $tpid -initcmd "source $thisScript" + tsv::set $tpid -initcmd "source -encoding utf-8 $thisScript" # # Override with user-supplied data diff --git a/tests/all.tcl b/tests/all.tcl index 74aca979..5db3146e 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -46,7 +46,7 @@ puts stdout "Mainthread id is $::tcltest::mainThread" foreach file [lsort [::tcltest::getMatchingFiles]] { set tail [file tail $file] puts stdout $tail - if {[catch {source $file} msg]} { + if {[catch {source -encoding utf-8 $file} msg]} { puts stdout $msg } }