From 63adcaa2f676c4f4b82d9ab5dba1abd07991d3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Sat, 5 Jun 2021 12:05:11 +0200 Subject: [PATCH] Reset locale after rendering Leaving locale as C breaks PDF export in Marker: https://github.com/fabiocolacio/Marker/issues/304#issuecomment-696388392 --- src/svg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg.c b/src/svg.c index 9e94a58..de3e583 100644 --- a/src/svg.c +++ b/src/svg.c @@ -706,6 +706,7 @@ title_to_svg(char* buffer, char * chart_to_svg(chart* chart) { + char * current = setlocale(LC_ALL, NULL); setlocale(LC_ALL, "C"); char * buffer = malloc(1024*1024*sizeof(char)); memset(buffer, 0, 1024*1024); @@ -737,6 +738,6 @@ chart_to_svg(chart* chart) ticks_free(x_t); ticks_free(y_t); - // setlocale(LC_ALL, "C"); + setlocale(LC_ALL, current); return buffer; }