summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/FileSystem.34
-rw-r--r--doc/InitSubSyst.34
-rw-r--r--doc/source.n2
-rw-r--r--generic/tclIOUtil.c36
-rw-r--r--generic/tclZlib.c2
-rw-r--r--library/auto.tcl8
-rw-r--r--library/clock.tcl2
-rw-r--r--library/init.tcl2
-rw-r--r--library/install.tcl6
-rw-r--r--library/package.tcl2
-rw-r--r--library/safe.tcl7
-rw-r--r--library/tm.tcl2
-rw-r--r--macosx/GNUmakefile15
-rw-r--r--macosx/README7
-rw-r--r--tests/source.test6
-rw-r--r--unix/README2
-rwxr-xr-xunix/configure7
-rw-r--r--unix/configure.ac2
-rw-r--r--unix/tcl.m44
-rw-r--r--unix/tclConfig.h.in3
-rw-r--r--unix/tclUnixInit.c2
-rwxr-xr-xwin/configure3
-rw-r--r--win/tcl.m43
23 files changed, 63 insertions, 68 deletions
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 681e834..eb388a2 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -414,7 +414,7 @@ caller (with a reference count of 0).
the encoding identified by \fIencodingName\fR and evaluates
its contents as a Tcl script. It returns the same information as
\fBTcl_EvalObjEx\fR.
-If \fIencodingName\fR is NULL, the system encoding is used for
+If \fIencodingName\fR is NULL, the utf-8 encoding is used for
reading the file contents.
If the file could not be read then a Tcl error is returned to describe
why the file could not be read.
@@ -430,7 +430,7 @@ or
which will be safely substituted by the Tcl interpreter into
.QW ^Z .
\fBTcl_FSEvalFile\fR is a simpler version of
-\fBTcl_FSEvalFileEx\fR that always uses the system encoding
+\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
when reading the file.
.PP
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3
index 3c138a4..7551145 100644
--- a/doc/InitSubSyst.3
+++ b/doc/InitSubSyst.3
@@ -23,9 +23,9 @@ first thing in the application's main program.
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
-used as utility library, no other encodings than utf8,
+used as utility library, no other encodings than utf-8,
iso8859-1 or unicode are used, and no interest exists in the
value of \fBinfo nameofexecutable\fR. The system encoding will not
-be extracted from the environment, but falls back to iso8859-1.
+be extracted from the environment, but falls back to utf-8.
.SH KEYWORDS
binary, executable file
diff --git a/doc/source.n b/doc/source.n
index 353b8fb..8757cb8 100644
--- a/doc/source.n
+++ b/doc/source.n
@@ -47,7 +47,7 @@ A leading BOM (Byte order mark) contained in the file is ignored for unicode enc
.PP
The \fB\-encoding\fR option is used to specify the encoding of
the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
-is omitted, the system encoding is assumed.
+is omitted, the utf-8 encoding is assumed.
.SH EXAMPLE
.PP
Run the script in the file \fBfoo.tcl\fR and then the script in the
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 144b8bd..4cd2c6d 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx(
* Tilde-substitution is performed on this
* pathname. */
const char *encodingName) /* Either the name of an encoding or NULL to
- use the system encoding. */
+ use the utf-8 encoding. */
{
size_t length;
int result = TCL_ERROR;
@@ -1723,16 +1723,16 @@ Tcl_FSEvalFileEx(
/*
* If the encoding is specified, set the channel to that encoding.
- * Otherwise don't touch it, leaving things up to the system encoding. If
- * the encoding is unknown report an error.
+ * Otherwise use utf-8. If the encoding is unknown report an error.
*/
- if (encodingName != NULL) {
- if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
- != TCL_OK) {
- Tcl_CloseEx(interp,chan,0);
- return result;
- }
+ if (encodingName == NULL) {
+ encodingName = "utf-8";
+ }
+ if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
+ != TCL_OK) {
+ Tcl_CloseEx(interp,chan,0);
+ return result;
}
TclNewObj(objPtr);
@@ -1822,7 +1822,7 @@ TclNREvalFile(
* evaluate. Tilde-substitution is performed on
* this pathname. */
const char *encodingName) /* The name of an encoding to use, or NULL to
- * use the system encoding. */
+ * use the utf-8 encoding. */
{
Tcl_StatBuf statBuf;
Tcl_Obj *oldScriptFile, *objPtr;
@@ -1859,16 +1859,16 @@ TclNREvalFile(
/*
* If the encoding is specified, set the channel to that encoding.
- * Otherwise don't touch it, leaving things up to the system encoding. If
- * the encoding is unknown report an error.
+ * Otherwise use utf-8. If the encoding is unknown report an error.
*/
- if (encodingName != NULL) {
- if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
- != TCL_OK) {
- Tcl_CloseEx(interp, chan, 0);
- return TCL_ERROR;
- }
+ if (encodingName == NULL) {
+ encodingName = "utf-8";
+ }
+ if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
+ != TCL_OK) {
+ Tcl_CloseEx(interp, chan, 0);
+ return TCL_ERROR;
}
TclNewObj(objPtr);
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 36064c5..154325a 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -3957,7 +3957,7 @@ TclZlibInit(
cfg[0].key = "zlibVersion";
cfg[0].value = zlibVersion();
cfg[1].key = NULL;
- Tcl_RegisterConfig(interp, "zlib", cfg, "iso8859-1");
+ Tcl_RegisterConfig(interp, "zlib", cfg, "utf-8");
/*
* Allow command type introspection to do something sensible with streams.
diff --git a/library/auto.tcl b/library/auto.tcl
index 32da97c..41ef1a0 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -265,7 +265,7 @@ proc auto_mkindex {dir args} {
auto_mkindex_parser::cleanup
set fid [open "tclIndex" w]
- fconfigure $fid -translation lf
+ fconfigure $fid -encoding utf-8 -translation lf
puts -nonewline $fid $index
close $fid
cd $oldDir
@@ -292,7 +292,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open $file]
- fconfigure $f -eofchar \032
+ fconfigure $f -encoding utf-8 -eofchar \032
while {[gets $f line] >= 0} {
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
set procName [lindex [auto_qualify $procName "::"] 0]
@@ -311,7 +311,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open tclIndex w]
- fconfigure $f -translation lf
+ fconfigure $f -encoding utf-8 -translation lf
puts -nonewline $f $index
close $f
cd $oldDir
@@ -404,7 +404,7 @@ proc auto_mkindex_parser::mkindex {file} {
set scriptFile $file
set fid [open $file]
- fconfigure $fid -eofchar \032
+ fconfigure $fid -encoding utf-8 -eofchar \032
set contents [read $fid]
close $fid
diff --git a/library/clock.tcl b/library/clock.tcl
index 2e42a98..54919f2 100644
--- a/library/clock.tcl
+++ b/library/clock.tcl
@@ -3314,7 +3314,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } {
"time zone \":$fileName\" not valid"
}
try {
- source -encoding utf-8 [file join $DataDir $fileName]
+ source [file join $DataDir $fileName]
} on error {} {
return -code error \
-errorcode [list CLOCK badTimeZone :$fileName] \
diff --git a/library/init.tcl b/library/init.tcl
index f5da944..f73d9e2 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -112,7 +112,7 @@ if {[interp issafe]} {
foreach cmd {add format scan} {
proc ::tcl::clock::$cmd args {
variable TclLibDir
- source -encoding utf-8 [file join $TclLibDir clock.tcl]
+ source [file join $TclLibDir clock.tcl]
return [uplevel 1 [info level 0]]
}
}
diff --git a/library/install.tcl b/library/install.tcl
index 26e5e68..8d37d78 100644
--- a/library/install.tcl
+++ b/library/install.tcl
@@ -35,7 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -59,7 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -79,7 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
set trace 0
diff --git a/library/package.tcl b/library/package.tcl
index 64fac7b..ac9a3dc 100644
--- a/library/package.tcl
+++ b/library/package.tcl
@@ -409,7 +409,7 @@ proc pkg_mkIndex {args} {
}
set f [open [file join $dir pkgIndex.tcl] w]
- fconfigure $f -translation lf
+ fconfigure $f -encoding utf-8 -translation lf
puts $f $index
close $f
}
diff --git a/library/safe.tcl b/library/safe.tcl
index a9bb7f3..7eea772 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -937,7 +937,7 @@ proc ::safe::AliasSource {child args} {
}
} else {
set at 0
- set encoding {}
+ set encoding utf-8
}
if {$argc != 1} {
set msg "wrong # args: should be \"source ?-encoding E? fileName\""
@@ -980,10 +980,7 @@ proc ::safe::AliasSource {child args} {
set replacementMsg "script error"
set code [catch {
set f [open $realfile]
- fconfigure $f -eofchar \032
- if {$encoding ne ""} {
- fconfigure $f -encoding $encoding
- }
+ fconfigure $f -encoding $encoding -eofchar \032
set contents [read $f]
close $f
::interp eval $child [list info script $file]
diff --git a/library/tm.tcl b/library/tm.tcl
index c60084c..3c0ec22 100644
--- a/library/tm.tcl
+++ b/library/tm.tcl
@@ -267,7 +267,7 @@ proc ::tcl::tm::UnknownHandler {original name args} {
# of the package file is the last element in the list.
package ifneeded $pkgname $pkgversion \
- "[::list package provide $pkgname $pkgversion];[::list source -encoding utf-8 $file]"
+ "[::list package provide $pkgname $pkgversion];[::list source $file]"
# We abort in this unknown handler only if we got a
# satisfying candidate for the requested package.
diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile
index 2b817c0..93fd843 100644
--- a/macosx/GNUmakefile
+++ b/macosx/GNUmakefile
@@ -32,6 +32,18 @@ MANDIR ?= ${PREFIX}/man
# set to non-empty value to install manpages in addition to html help:
INSTALL_MANPAGES ?=
+# Checks and overrides for subframework builds
+ifeq (${SUBFRAMEWORK},1)
+ifeq (${DYLIB_INSTALL_DIR},)
+ @echo "Cannot install subframework with empty DYLIB_INSTALL_DIR !" && false
+endif
+ifeq (${DESTDIR},)
+ @echo "Cannot install subframework with empty DESTDIR !" && false
+endif
+override BUILD_DIR = ${DESTDIR}/build
+override INSTALL_PATH = /Frameworks
+endif
+
#-------------------------------------------------------------------------------------------------------
# meta targets
@@ -150,9 +162,6 @@ install-${PROJECT}: build-${PROJECT}
ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_)
@echo "Cannot install-embedded with empty INSTALL_ROOT !" && false
endif
-ifeq (${SUBFRAMEWORK}_${DYLIB_INSTALL_DIR},1_)
- @echo "Cannot install-subframework with empty DYLIB_INSTALL_DIR !" && false
-endif
ifeq (${EMBEDDED_BUILD},1)
@rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework"
endif
diff --git a/macosx/README b/macosx/README
index 5e53e64..cd3071f 100644
--- a/macosx/README
+++ b/macosx/README
@@ -172,7 +172,6 @@ variable to the path which should be the install_name path of the Tcl library, s
the DESTDIR variable to the pathname of a staging directory where the framework
will be written . For example, running this command in the Tcl source directory:
make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \
- DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/3.9/Frameworks/Tcl
-will produce a Tcl.framework intended for installing as a subframework of the
-Python.framework. The framework will be found in /tmp/tcl/Library/Frameworks/
-
+ DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework
+will produce a Tcl.framework intended for installing as a subframework of
+Some.framework. The framework will be found in /tmp/tcl/Frameworks/
diff --git a/tests/source.test b/tests/source.test
index c6cccd6..378d62e 100644
--- a/tests/source.test
+++ b/tests/source.test
@@ -114,7 +114,7 @@ test source-2.7 {utf-8 with BOM} -setup {
puts $out "\ufeffset y new-y"
close $out
set y old-y
- source -encoding utf-8 $sourcefile
+ source $sourcefile
return $y
} -cleanup {
removeFile $sourcefile
@@ -226,7 +226,7 @@ test source-7.1 {source -encoding test} -setup {
close $f
} -body {
set x unset
- source -encoding utf-8 $sourcefile
+ source $sourcefile
set x
} -cleanup {
removeFile source.file
@@ -269,7 +269,7 @@ test source-7.5 {source -encoding: correct operation} -setup {
puts $f "proc \u20ac {} {return foo}"
close $f
} -body {
- source -encoding utf-8 $sourcefile
+ source $sourcefile
\u20ac
} -cleanup {
removeFile source.file
diff --git a/unix/README b/unix/README
index 3340dc6..3c1a207 100644
--- a/unix/README
+++ b/unix/README
@@ -91,7 +91,7 @@ How To Compile And Install Tcl:
for descriptions of the probes made available,
see http://wiki.tcl.tk/DTrace for more details
--with-encoding=ENCODING Specifies the encoding for compile-time
- configuration values. Defaults to iso8859-1,
+ configuration values. Defaults to utf-8,
which is also sufficient for ASCII.
--with-tzdata=FLAG Specifies whether to install timezone data. By
default, the configure script tries to detect
diff --git a/unix/configure b/unix/configure
index c5ccc87..427e9fb 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1430,7 +1430,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-encoding encoding for configuration values (default:
- iso8859-1)
+ utf-8)
--with-system-libtommath
use external libtommath (default: true if available,
false otherwise)
@@ -3982,7 +3982,7 @@ _ACEOF
else
-$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h
+$as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h
fi
@@ -9739,9 +9739,6 @@ done
$as_echo "#define USE_VFORK 1" >>confdefs.h
-$as_echo "#define TCL_DEFAULT_ENCODING \"utf-8\"" >>confdefs.h
-
-
$as_echo "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h
diff --git a/unix/configure.ac b/unix/configure.ac
index c482fc4..4f90ce7 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -606,8 +606,6 @@ if test "`uname -s`" = "Darwin" ; then
AC_CHECK_FUNCS(OSSpinLockLock)
fi
AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?])
- AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8",
- [Are we to override what our default encoding is?])
AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1,
[Can this platform load code from memory?])
AC_DEFINE(TCL_WIDE_CLICKS, 1,
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index a9ee2d3..0473692 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2445,14 +2445,14 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFUN([SC_TCL_CFG_ENCODING], [
AC_ARG_WITH(encoding,
AC_HELP_STRING([--with-encoding],
- [encoding for configuration values (default: iso8859-1)]),
+ [encoding for configuration values (default: utf-8)]),
with_tcencoding=${withval})
if test x"${with_tcencoding}" != x ; then
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}",
[What encoding should be used for embedded configuration info?])
else
- AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1",
+ AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8",
[What encoding should be used for embedded configuration info?])
fi
])
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 1328d51..731ed95 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -415,9 +415,6 @@
/* Are bytecode statistics enabled? */
#undef TCL_COMPILE_STATS
-/* Are we to override what our default encoding is? */
-#undef TCL_DEFAULT_ENCODING
-
/* Is Tcl built as a framework? */
#undef TCL_FRAMEWORK
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index c356a15..0332803 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -92,7 +92,7 @@ typedef struct {
*/
#ifndef TCL_DEFAULT_ENCODING
-#define TCL_DEFAULT_ENCODING "iso8859-1"
+#define TCL_DEFAULT_ENCODING "utf-8"
#endif
/*
diff --git a/win/configure b/win/configure
index 8dd03e3..50138d7 100755
--- a/win/configure
+++ b/win/configure
@@ -3747,8 +3747,7 @@ fi
_ACEOF
else
- # Default encoding on windows is not "iso8859-1"
- $as_echo "#define TCL_CFGVAL_ENCODING \"cp1252\"" >>confdefs.h
+ $as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h
fi
diff --git a/win/tcl.m4 b/win/tcl.m4
index fdb0641..3211d1a 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -1085,8 +1085,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [
if test x"${with_tcencoding}" != x ; then
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}")
else
- # Default encoding on windows is not "iso8859-1"
- AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252")
+ AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8")
fi
])