Index: openacs-4/packages/acs-tcl/tcl/test/00-icanuse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/00-icanuse-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/test/00-icanuse-procs.tcl 3 Sep 2024 15:37:34 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/test/00-icanuse-procs.tcl 1 Oct 2024 12:44:32 -0000 1.3 @@ -15,8 +15,7 @@ } { aa_section "Test a plain Tcl command" - set flags { - bytelength + set subcmds { compare equal first @@ -40,23 +39,23 @@ wordstart } - foreach flag $flags { - aa_true "string subcommand '$flag' is recognized" [acs::cmd_has_subcommand string $flag] + foreach subcmd $subcmds { + aa_true "string subcommand '$subcmd' is recognized" [acs::cmd_has_subcommand string $subcmd] } - set flag [ad_generate_random_string] - aa_false "string has no subcommand called '$flag'" [acs::cmd_has_subcommand string $flag] + set subcmd [ad_generate_random_string] + aa_false "string has no subcommand called '$subcmd'" [acs::cmd_has_subcommand string $subcmd] aa_section "Test NaviServer subcommands" - set flags { + set subcmds { get set } - foreach flag $flags { - aa_true "nsv_array subcommand '$flag' is recognized" \ - [acs::cmd_has_subcommand nsv_array $flag] + foreach subcmd $subcmds { + aa_true "nsv_array subcommand '$subcmd' is recognized" \ + [acs::cmd_has_subcommand nsv_array $subcmd] } - set flag [ad_generate_random_string] - aa_false "nsv_array has no subcommand called '$flag'" \ - [acs::cmd_has_subcommand nsv_array $flag] + set subcmd [ad_generate_random_string] + aa_false "nsv_array has no subcommand called '$subcmd'" \ + [acs::cmd_has_subcommand nsv_array $subcmd] } Index: openacs-4/packages/acs-templating/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/element-procs.tcl,v diff -u -r1.39 -r1.40 --- openacs-4/packages/acs-templating/tcl/element-procs.tcl 11 Sep 2024 06:15:48 -0000 1.39 +++ openacs-4/packages/acs-templating/tcl/element-procs.tcl 1 Oct 2024 12:44:32 -0000 1.40 @@ -692,7 +692,12 @@ # A maximum length was specified for this element. Make # sure it is respected first. # - set value_bytelength [string bytelength $value] + + # Tcl9 does not include "string bytelength". Use idiom + # from Rolf Ade's Tcl9 migration guide instead. + #set value_bytelength [string bytelength $value] + set value_bytelength [string length [encoding convertto utf-8 $value]] + if { $value_bytelength > $element(maxlength) } { # # The element is too long.