Skip to content

Commit

Permalink
Add even more "-encoding utf-8" in various places
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Apr 16, 2024
1 parent 0cb63a2 commit 438b053
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions pkgIndex.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tcl/cmdsrv/cmdsrv.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Example:
#
# # tclsh8.6
# % source cmdsrv.tcl
# % source -encoding utf-8 cmdsrv.tcl
# % cmdsrv::create 5000 -idletime 60
# % vwait forever
#
Expand Down Expand Up @@ -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}
}

#
Expand Down
8 changes: 4 additions & 4 deletions tcl/phttpd/phttpd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Example:
#
# # tclsh8.6
# % source phttpd.tcl
# % source -encoding utf-8 phttpd.tcl
# % phttpd::create 5000
# % vwait forever
#
Expand All @@ -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 {
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tcl/phttpd/uhttpd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Example:
#
# # tclsh8.6
# % source uhttpd.tcl
# % source -encoding utf-8 uhttpd.tcl
# % uhttpd::create 5000
# % vwait forever
#
Expand Down
2 changes: 1 addition & 1 deletion tcl/tpool/tpool.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/all.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 438b053

Please sign in to comment.