diff --git a/backend/ps.c b/backend/ps.c index 1bda5ddc..dc7ce9c2 100644 --- a/backend/ps.c +++ b/backend/ps.c @@ -19,6 +19,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include #include #include @@ -45,6 +46,7 @@ int ps_plot(struct zint_symbol *symbol) float scaler = symbol->scale; float default_text_posn; int plot_text = 1; + const char *locale = NULL; row_height=0; textdone = 0; @@ -85,6 +87,7 @@ int ps_plot(struct zint_symbol *symbol) strcpy(symbol->errtxt, "Malformed background colour target"); return ERROR_INVALID_OPTION; } + locale = setlocale(LC_ALL, "C"); fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]); fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]); @@ -767,6 +770,9 @@ int ps_plot(struct zint_symbol *symbol) fclose(feps); + if (locale) + setlocale(LC_ALL, locale); + return error_number; } diff --git a/backend/svg.c b/backend/svg.c index 0c4d6977..68fb871d 100644 --- a/backend/svg.c +++ b/backend/svg.c @@ -19,6 +19,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include #include #include @@ -41,6 +42,7 @@ int svg_plot(struct zint_symbol *symbol) float scaler = symbol->scale; float default_text_posn; int plot_text = 1; + const char *locale = NULL; row_height=0; textdone = 0; @@ -81,6 +83,7 @@ int svg_plot(struct zint_symbol *symbol) strcpy(symbol->errtxt, "Malformed background colour target"); return ERROR_INVALID_OPTION; } + locale = setlocale(LC_ALL, "C"); fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]); fggrn = (16 * ctoi(symbol->fgcolour[2])) + ctoi(symbol->fgcolour[3]); @@ -614,6 +617,9 @@ int svg_plot(struct zint_symbol *symbol) fclose(fsvg); + if (locale) + setlocale(LC_ALL, locale); + return error_number; }