Skip to content

Commit

Permalink
Add even more "-encoding utf-8"
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Apr 16, 2024
1 parent ce67f7f commit 5e76728
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion generic/itclBase.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static const char initScript[] =
" }\n"
" foreach i $dirs {\n"
" set library $i\n"
" if {![catch {uplevel #0 [list source [file join $i itcl.tcl]]}]} {\n"
" if {![catch {uplevel #0 [list source -encoding utf-8 [file join $i itcl.tcl]]}]} {\n"
" set library $i\n"
" return\n"
" }\n"
Expand Down
2 changes: 1 addition & 1 deletion generic/itclBuiltin.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static char initHullCmdsScript[] =
" foreach i $dirs {\n"
" set library $i\n"
" set itclfile [file join $i itclHullCmds.tcl]\n"
" if {![catch {uplevel #0 [list source $itclfile]} msg]} {\n"
" if {![catch {uplevel #0 [list source -encoding utf-8 $itclfile]} msg]} {\n"
" return\n"
" }\n"
"puts stderr \"MSG!$msg!\"\n"
Expand Down
8 changes: 4 additions & 4 deletions library/itcl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ foreach __cmd {itcl::class class itcl::type type ictl::widget widget itcl::widge
variable index
variable scriptFile
append index "set [list auto_index([fullname $name])]"
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
append index " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n"

variable parser
variable contextStack
Expand All @@ -72,7 +72,7 @@ foreach __cmd {itcl::body body} {
variable index
variable scriptFile
append index "set [list auto_index([fullname $name])]"
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
append index " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n"
}
}

Expand All @@ -85,7 +85,7 @@ foreach __cmd {itcl::configbody configbody} {
variable index
variable scriptFile
append index "set [list auto_index([fullname $name])]"
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
append index " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n"
}
}

Expand All @@ -98,7 +98,7 @@ foreach __cmd {itcl::ensemble ensemble} {
variable index
variable scriptFile
append index "set [list auto_index([fullname $name])]"
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
append index " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n"
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if {[namespace which -command memory] ne "" && (
load {} Itcl i
i eval {set ::tcl::inl_mem_test 0}
i eval {package require tcltest; @testargv@}
i eval [list source @test@]
i eval [list source -encoding utf-8 @test@]
interp delete i
}]]
if {$leak} {
Expand Down
6 changes: 3 additions & 3 deletions tests/mkindex.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ test mkindex-1.2 {build tclIndex based on a test file} {
file exists tclIndex
} {1}

set element "{source [file join . mkindex.itcl]}"
set element "{source *[file join . mkindex.itcl]}"

test mkindex-1.3 {examine tclIndex} {
test mkindex-1.3 {examine tclIndex} -body {
namespace eval itcl_mkindex_tmp {
set dir "."
variable auto_index
Expand All @@ -50,7 +50,7 @@ test mkindex-1.3 {examine tclIndex} {
}
set result
}
} "{::Simple2::bump $element} {::Simple2::by $element} {::buried::deep::within $element} {::buried::ens $element} {::buried::inside $element} {::buried::inside::bump $element} {::buried::inside::by $element} {::buried::inside::find $element} {::buried::under::neath $element} {::top::find $element} {::top::notice $element} {Simple1 $element} {Simple2 $element} {ens $element} {top $element}"
} -match glob -result "{::Simple2::bump $element} {::Simple2::by $element} {::buried::deep::within $element} {::buried::ens $element} {::buried::inside $element} {::buried::inside::bump $element} {::buried::inside::by $element} {::buried::inside::find $element} {::buried::under::neath $element} {::top::find $element} {::top::notice $element} {Simple1 $element} {Simple2 $element} {ens $element} {top $element}"

file delete tclIndex
::tcltest::cleanupTests
Expand Down
30 changes: 15 additions & 15 deletions tests/tclIndex
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(Simple1) [list source [file join $dir mkindex.itcl]]
set auto_index(Simple2) [list source [file join $dir mkindex.itcl]]
set auto_index(ens) [list source [file join $dir mkindex.itcl]]
set auto_index(::Simple2::bump) [list source [file join $dir mkindex.itcl]]
set auto_index(::Simple2::by) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::inside) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::find) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::bump) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::by) [list source [file join $dir mkindex.itcl]]
set auto_index(top) [list source [file join $dir mkindex.itcl]]
set auto_index(::top::find) [list source [file join $dir mkindex.itcl]]
set auto_index(::top::notice) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::ens) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::under::neath) [list source [file join $dir mkindex.itcl]]
set auto_index(::buried::deep::within) [list source [file join $dir mkindex.itcl]]
set auto_index(Simple1) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(Simple2) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(ens) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::Simple2::bump) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::Simple2::by) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::inside) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::find) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::bump) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::inside::by) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(top) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::top::find) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::top::notice) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::ens) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::under::neath) [list source -encoding utf-8 [file join $dir mkindex.itcl]]
set auto_index(::buried::deep::within) [list source -encoding utf-8 [file join $dir mkindex.itcl]]

0 comments on commit 5e76728

Please sign in to comment.