mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-27 21:44:13 -04:00
Make locale aware
This commit is contained in:
parent
91251fbc26
commit
f8b6fb20aa
2 changed files with 12 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue