diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-11-04 18:18:03 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-11-04 18:18:03 (GMT) |
commit | 05f6317032522fa4b68966fe3c1ef854d87fbf6e (patch) | |
tree | 080fd0720b470aa04f090111e31e27826a699452 | |
parent | c2f30c4326efeeaff9b28a2015ab079750bfd038 (diff) | |
download | tcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.zip tcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.tar.gz tcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.tar.bz2 |
Bug 1317477
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | compat/strftime.c | 32 |
2 files changed, 27 insertions, 12 deletions
@@ -1,3 +1,10 @@ +2005-11-04 Kevin Kenny <kennykb@acm.org> + + * compat/strftime.c: Fixed a problem where the name of the + time zone was double-converted from system encoding to + UTF-8. Thanks to the anonymous submitter of [Bug 1317477] + for the report and the patch. + 2005-11-04 Miguel Sofer <msofer@users.sf.net> * generic/tclInt.h: diff --git a/compat/strftime.c b/compat/strftime.c index 609c193..7d2c416 100644 --- a/compat/strftime.c +++ b/compat/strftime.c @@ -10,7 +10,7 @@ * * Changes 2002 Copyright (c) 2002 ActiveState Corporation. * - * RCS: @(#) $Id: strftime.c,v 1.10.2.2 2004/09/08 18:32:20 kennykb Exp $ + * RCS: @(#) $Id: strftime.c,v 1.10.2.3 2005/11/04 18:18:04 kennykb Exp $ */ /* @@ -47,7 +47,7 @@ */ #if defined(LIBC_SCCS) -static char *rcsid = "$Id: strftime.c,v 1.10.2.2 2004/09/08 18:32:20 kennykb Exp $"; +static char *rcsid = "$Id: strftime.c,v 1.10.2.3 2005/11/04 18:18:04 kennykb Exp $"; #endif /* LIBC_SCCS */ #include <time.h> @@ -339,9 +339,11 @@ _fmt(format, t) * we must make use of the special localized calls. */ case 'c': - if (!GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, - &syst, NULL, buf, BUF_SIZ) || !_add(buf) - || !_add(" ")) { + if (!GetDateFormat(LOCALE_USER_DEFAULT, + DATE_LONGDATE | LOCALE_USE_CP_ACP, + &syst, NULL, buf, BUF_SIZ) + || !_add(buf) + || !_add(" ")) { return(0); } /* @@ -349,14 +351,18 @@ _fmt(format, t) * so continue to %X case here. */ case 'X': - if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, - &syst, NULL, buf, BUF_SIZ) || !_add(buf)) { + if (!GetTimeFormat(LOCALE_USER_DEFAULT, + LOCALE_USE_CP_ACP, + &syst, NULL, buf, BUF_SIZ) + || !_add(buf)) { return(0); } continue; case 'x': - if (!GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, - &syst, NULL, buf, BUF_SIZ) || !_add(buf)) { + if (!GetDateFormat(LOCALE_USER_DEFAULT, + DATE_SHORTDATE | LOCALE_USE_CP_ACP, + &syst, NULL, buf, BUF_SIZ) + || !_add(buf)) { return(0); } continue; @@ -385,9 +391,11 @@ _fmt(format, t) continue; case 'Z': { char *name = (isGMT ? "GMT" : TclpGetTZName(t->tm_isdst)); - if (name && !_add(name)) { - return 0; - } + int wrote; + Tcl_UtfToExternal(NULL, NULL, name, -1, 0, NULL, + pt, gsize, NULL, &wrote, NULL); + pt += wrote; + gsize -= wrote; continue; } case '%': |