Posted to tcl by miguel at Sun May 25 22:11:01 GMT 2008view pretty
mig@cpq:/home/CVS/tcl_SF_clean/unix$ tclsh % set body { set system [encoding system] set path [encoding dirs] encoding system shiftjis ;# incr ref count encoding dirs [list [pwd]] set x [encoding convertto shiftjis \u4e4e] ;# old one found encoding system identity lappend x [catch {encoding convertto shiftjis \u4e4e} msg] $msg encoding system identity encoding dirs $path encoding system $system set x } set system [encoding system] set path [encoding dirs] encoding system shiftjis ;# incr ref count encoding dirs [list [pwd]] set x [encoding convertto shiftjis \u4e4e] ;# old one found encoding system identity lappend x [catch {encoding convertto shiftjis \u4e4e} msg] $msg encoding system identity encoding dirs $path encoding system $system set x % eval $body Á 1 {unknown encoding "shiftjis"} % proc foo {} $body % foo Á 0 Á