From 6b95d3e5eb8086185b29be9df9f1ecf1661c3db6 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Tue, 18 Mar 2008 18:14:56 +0000 Subject: * library/tm.tcl (::tcl::tm::UnknownHandler): Changed 'source' to 'source -encoding utf-8'. This fixes a portability problem of Tcl Modules pointed out by Don Porter. By using plain 'source' we were at the mercy of 'encoding system', making modules less portable than they could be. The exact scenario: A writes a TM in some weird encoding which is A's system encoding, distributes it, and somewhere else it cannot be read/used because the system encoding is different. Forcing the use of utf-8 makes the module portable. ***INCOMPATIBILITY*** for all Tcl Modules already written in non-utf-8 compatible encodings. --- ChangeLog | 15 +++++++++++++++ library/tm.tcl | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9219be8..c43d727 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-03-18 Andreas Kupries + + * library/tm.tcl (::tcl::tm::UnknownHandler): Changed 'source' to + 'source -encoding utf-8'. This fixes a portability problem of + Tcl Modules pointed out by Don Porter. By using plain 'source' + we were at the mercy of 'encoding system', making modules less + portable than they could be. The exact scenario: A writes a TM + in some weird encoding which is A's system encoding, distributes + it, and somewhere else it cannot be read/used because the system + encoding is different. Forcing the use of utf-8 makes the module + portable. + + ***INCOMPATIBILITY*** for all Tcl Modules already written in + non-utf-8 compatible encodings. + 2008-03-18 Don Porter * generic/tclExecute.c: Patch from Miguel Sofer to correct the diff --git a/library/tm.tcl b/library/tm.tcl index baf3667..aee74f5 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -254,7 +254,7 @@ proc ::tcl::tm::UnknownHandler {original name args} { # means something else without the namespace # specifier. - package ifneeded $pkgname $pkgversion [::list source $file] + package ifneeded $pkgname $pkgversion [::list source -encoding utf-8 $file] # We abort in this unknown handler only if we got # a satisfying candidate for the requested -- cgit v0.12