summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--unix/tclUnixTime.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index cb1c4a9..620fc60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-19 Kevin B. Kenny <kennykb@hippolyta>
+
+ * unix/tclUnixTime.c: Corrected a bug in conversion of non-ASCII
+ chars in the format string.
+
2003-05-19 Daniel Steffen <das@users.sourceforge.net>
* macosx/Tcl.pbproj/project.pbxproj: changed tclConfig.sh location
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 4ee9df9..4f10312 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.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: tclUnixTime.c,v 1.17 2003/05/19 05:42:36 das Exp $
+ * RCS: @(#) $Id: tclUnixTime.c,v 1.18 2003/05/19 17:25:37 kennykb Exp $
*/
#include "tclInt.h"
@@ -328,6 +328,7 @@ TclpStrftime(s, maxsize, format, t, useGMT)
{
Tcl_DString utf8Buffer;
size_t status;
+ char* utf8Format;
if (format[0] == '%' && format[1] == 'Q') {
/* Format as a stardate */
sprintf(s, "Stardate %2d%03d.%01d",
@@ -337,11 +338,14 @@ TclpStrftime(s, maxsize, format, t, useGMT)
(((t->tm_hour * 60) + t->tm_min)/144));
return(strlen(s));
} else {
+ Tcl_DStringInit( &utf8Buffer );
+ utf8Format = Tcl_UtfToExternalDString( NULL, format, -1, &utf8Buffer );
setlocale(LC_TIME, "");
- status = strftime(s, maxsize, format, t);
+ status = strftime( s, maxsize, utf8Format, t );
+ Tcl_DStringFree( &utf8Buffer );
if ( status > 0 ) {
Tcl_DStringInit ( &utf8Buffer );
- Tcl_ExternalToUtfDString( NULL, s, status, &utf8Buffer );
+ Tcl_ExternalToUtfDString( NULL, s, (int) status, &utf8Buffer );
strcpy( s, Tcl_DStringValue( &utf8Buffer ) );
Tcl_DStringFree( &utf8Buffer );
}