diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2007-11-05 19:58:48 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2007-11-05 19:58:48 (GMT) |
commit | 50655806f0d417102e01672cd30e5f10a7b8e24b (patch) | |
tree | ca15b3374494e46f7dad1dac0b05227e622c64dd | |
parent | 0b53d151fdd7349022804a7857573aae963afdbc (diff) | |
download | tcl-50655806f0d417102e01672cd30e5f10a7b8e24b.zip tcl-50655806f0d417102e01672cd30e5f10a7b8e24b.tar.gz tcl-50655806f0d417102e01672cd30e5f10a7b8e24b.tar.bz2 |
* generic/tclConfig.c (Tcl_RegisterConfig): Modified to use
iso8859-1 as a fallback if the user supplied encoding was not
found. That way we do not crash. It is unclear however if this
is a sane fallback given that the encoding is likely wrong and
producing bogus strings. See [SF Tcl Bug 983509] for more
discussion.
FossilOrigin-Name: 8bb17255849fdfacfa51d0cce4443882c75668aa
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tclConfig.c | 7 |
2 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2007-11-05 Andreas Kupries <andreask@activestate.com> + + * generic/tclConfig.c (Tcl_RegisterConfig): Modified to use + iso8859-1 as a fallback if the user supplied encoding was not + found. That way we do not crash. It is unclear however if this + is a sane fallback given that the encoding is likely wrong and + producing bogus strings. See [SF Tcl Bug 983509] for more + discussion. + 2007-11-05 Andreas Kupries <andreask@activestate.com> * unix/tclUnixChan.c (TtyGetOptionProc): Accepted [SF Tcl Patch diff --git a/generic/tclConfig.c b/generic/tclConfig.c index 1199e81..e7d9bf3 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclConfig.c,v 1.14 2007/04/10 14:47:10 dkf Exp $ + * RCS: @(#) $Id: tclConfig.c,v 1.15 2007/11/05 19:58:48 andreas_kupries Exp $ */ #include "tclInt.h" @@ -71,6 +71,11 @@ Tcl_RegisterConfig( Tcl_Config *cfg; Tcl_Encoding venc = Tcl_GetEncoding(NULL, valEncoding); + if (venc == NULL) { + /* Fall back to a builtin encoding if the user supplied one is bogus. */ + venc = Tcl_GetEncoding(NULL, "iso8859-1"); + } + pDB = GetConfigDict(interp); pkg = Tcl_NewStringObj(pkgName, -1); |