prevent non-English characters (e.g. Umlaute),

which gtkwave does not understand
This commit is contained in:
Holger Vogt 2020-03-22 00:15:59 +01:00
parent 3a6a445241
commit 96976ee49d
1 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,7 @@ NON-STANDARD FEATURES
#include "ngspice/evtproto.h"
#include <time.h>
#include <locale.h>
static int get_index(char *node_name);
@ -573,6 +574,10 @@ EVTprintvcd(wordlist *wl)
out_init();
/* for gtkwave, avoid e.g. German Umlaute */
setlocale(LC_TIME, "en_US");
/* get actual time */
time_t ltime;
char datebuff[80];
@ -585,6 +590,9 @@ EVTprintvcd(wordlist *wl)
strftime(datebuff, sizeof(datebuff), "%B %d, %Y %H:%M:%S", my_time);
out_printf("$date %s $end\n", datebuff);
/* return to what it was before */
setlocale(LC_TIME, "");
out_printf("$version %s %s $end\n", ft_sim->simulator, ft_sim->version);
/* get the sim time resolution based on tstep */