@@ -88,21 +88,25 @@ } # fix system encoding, if it wasn't properly set up (200207.004 bug) if {[encoding system] eq "identity"} { if {[info exists ::tclkit_system_encoding] && $::tclkit_system_encoding != ""} { - encoding system $::tclkit_system_encoding - } else { - switch $::tcl_platform(platform) { - windows { encoding system cp1252 } - macintosh { encoding system macRoman } - default { encoding system iso8859-1 } + catch { + encoding system $::tclkit_system_encoding } } - unset -nocomplain ::tclkit_system_encoding } + + # If we've still not been able to set the encoding, revert to Tclkit defaults + if {[encoding system] eq "identity"} { + switch $::tcl_platform(platform) { + windows { encoding system cp1252 } + macintosh { encoding system macRoman } + default { encoding system iso8859-1 } + } + } # now remount the executable with the correct encoding vfs::filesystem unmount [lindex [::vfs::filesystem info] 0] set noe [info nameofexecutable]