Index: openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl,v diff -u -r1.8.2.3 -r1.8.2.4 --- openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 17 Nov 2020 12:00:59 -0000 1.8.2.3 +++ openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 18 Mar 2021 16:03:25 -0000 1.8.2.4 @@ -32,6 +32,17 @@ [expr {[clock clicks -milliseconds] - $start_time}]ms (potential configuration issue)" } + # Check that encoding in the proxied interpreter is the same + # as in the main interpreter. If not, we set it the same and + # reset it after command execution. + set proxy_encoding [ns_proxy eval $handle [list encoding system]] + if {$proxy_encoding eq [encoding system]} { + set reset_encoding_p 0 + } else { + ns_proxy eval $handle [list encoding system [encoding system]] + set reset_encoding_p 1 + } + ad_try { if {[info exists cd]} { # @@ -45,6 +56,10 @@ set exec_flags [expr {$ignorestderr_p ? "-ignorestderr --" : ""}] set return_string [ns_proxy eval $handle [list ::exec {*}$exec_flags {*}$call]] } finally { + if {$reset_encoding_p} { + ns_proxy eval $handle [list encoding system $proxy_encoding] + } + if {[info exists pwd]} { # # Switch back to the previous directory.