summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2003-05-18 19:48:25 (GMT)
committerKevin B Kenny <kennykb@acm.org>2003-05-18 19:48:25 (GMT)
commita7ae75e85360445c96accf3acfc542dbe4e60519 (patch)
tree51b5e23a67cd4e57f7e7c0df5dd394a956f99f28 /generic
parentb8ab7934b3d5103f68277fb3671b30d22876303c (diff)
downloadtcl-a7ae75e85360445c96accf3acfc542dbe4e60519.zip
tcl-a7ae75e85360445c96accf3acfc542dbe4e60519.tar.gz
tcl-a7ae75e85360445c96accf3acfc542dbe4e60519.tar.bz2
* compat/strftime.c: Modified TclpStrftime to return its
* generic/tclClock.c: result in UTF-8 encoding, and removed * mac/tclMacTime.c: the conversion from system encoding to * unix/tclUnixTime.c: UTF-8 from [clock format]. Needed to * win/tclWinTime.c: avoid double conversion of the timezone name on Windows systems. [Bug 624408]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclClock.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 221f961..db6167e 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclClock.c,v 1.22 2003/04/15 03:43:26 dgp Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.23 2003/05/18 19:48:26 kennykb Exp $
*/
#include "tcl.h"
@@ -264,7 +264,7 @@ FormatClock(interp, clockVal, useGMT, format)
char *format; /* Format string */
{
struct tm *timeDataPtr;
- Tcl_DString buffer, uniBuffer;
+ Tcl_DString buffer;
int bufSize;
char *p;
int result;
@@ -336,8 +336,7 @@ FormatClock(interp, clockVal, useGMT, format)
bufSize++;
}
}
- Tcl_DStringInit(&uniBuffer);
- Tcl_UtfToExternalDString(NULL, format, -1, &uniBuffer);
+
Tcl_DStringInit(&buffer);
Tcl_DStringSetLength(&buffer, bufSize);
@@ -346,12 +345,11 @@ FormatClock(interp, clockVal, useGMT, format)
#if defined(HAVE_TM_ZONE) || defined(WIN32)
Tcl_MutexLock(&clockMutex);
#endif
- result = TclpStrftime(buffer.string, (unsigned int) bufSize,
- Tcl_DStringValue(&uniBuffer), timeDataPtr, useGMT);
+ result = TclpStrftime( buffer.string, (unsigned int) bufSize,
+ format, timeDataPtr, useGMT);
#if defined(HAVE_TM_ZONE) || defined(WIN32)
Tcl_MutexUnlock(&clockMutex);
#endif
- Tcl_DStringFree(&uniBuffer);
#if !defined(HAVE_TM_ZONE) && !defined(WIN32)
if (useGMT) {
@@ -379,15 +377,8 @@ FormatClock(interp, clockVal, useGMT, format)
return TCL_ERROR;
}
- /*
- * Convert the time to UTF from external encoding [Bug: 3345]
- */
- Tcl_DStringInit(&uniBuffer);
- Tcl_ExternalToUtfDString(NULL, buffer.string, -1, &uniBuffer);
-
- Tcl_SetStringObj(Tcl_GetObjResult(interp), uniBuffer.string, -1);
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), buffer.string, -1);
- Tcl_DStringFree(&uniBuffer);
Tcl_DStringFree(&buffer);
return TCL_OK;
}