Index: generic/tls.c ================================================================== --- generic/tls.c +++ generic/tls.c @@ -2731,10 +2731,16 @@ } dprintf("Returning"); } +#if TCL_MAJOR_VERSION > 8 +#define MIN_VERSION "9.0" +#else +#define MIN_VERSION "8.5" +#endif + /* *------------------------------------------------------------------- * * Tls_Init -- * @@ -2754,29 +2760,18 @@ 0x00 }; dprintf("Called"); -#if TCL_MAJOR_VERSION > 8 #ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, "9.0", 0) == NULL) { + if (Tcl_InitStubs(interp, MIN_VERSION, 0) == NULL) { return TCL_ERROR; } #endif - if (Tcl_PkgRequire(interp, "Tcl", "9.0-", 0) == NULL) { + if (Tcl_PkgRequire(interp, "Tcl", MIN_VERSION, 0) == NULL) { return TCL_ERROR; } -#else -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { - return TCL_ERROR; - } -#endif - if (Tcl_PkgRequire(interp, "Tcl", "8.5-", 0) == NULL) { - return TCL_ERROR; - } -#endif if (TlsLibInit(0) != TCL_OK) { Tcl_AppendResult(interp, "could not initialize SSL library", (char *) NULL); return TCL_ERROR; } Index: pkgIndex.tcl.in ================================================================== --- pkgIndex.tcl.in +++ pkgIndex.tcl.in @@ -4,11 +4,11 @@ if {[package vsatisfies [package provide Tcl] 9.0-]} { package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \ [list load [file join $dir @PKG_LIB_FILE9@] [string totitle @PACKAGE_NAME@]] set initScript [file join $dir @PACKAGE_NAME@.tcl] if {[file exists $initScript]} { - source $initScript + source -encoding utf-8 $initScript } } else { if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ [list apply {{dir} { if {[string tolower [file extension @PKG_LIB_FILE8@]] in [list ".dll" ".so"]} { @@ -16,9 +16,9 @@ } else { load {} [string totitle @PACKAGE_NAME@] } set initScript [file join $dir @PACKAGE_NAME@.tcl] if {[file exists $initScript]} { - source $initScript + source -encoding utf-8 $initScript } }} $dir] }