diff options
author | kennykb <kennykb@noemail.net> | 2005-11-04 18:18:02 (GMT) |
---|---|---|
committer | kennykb <kennykb@noemail.net> | 2005-11-04 18:18:02 (GMT) |
commit | 9b02d5bbcd73254f8ef306e8a9e4a4f311ea34b3 (patch) | |
tree | 080fd0720b470aa04f090111e31e27826a699452 | |
parent | 4e158cd85bff0e70d9533aad970710cac40c623e (diff) | |
download | tcl-9b02d5bbcd73254f8ef306e8a9e4a4f311ea34b3.zip tcl-9b02d5bbcd73254f8ef306e8a9e4a4f311ea34b3.tar.gz tcl-9b02d5bbcd73254f8ef306e8a9e4a4f311ea34b3.tar.bz2 |
Bug 1317477
FossilOrigin-Name: d64beb6fe2fdabbc723fa2ba32afceb7fd98f2bc
-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 '%': |