diff options
| -rw-r--r-- | src/lingot-config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lingot-config.c b/src/lingot-config.c index a46e372..9886ac8 100644 --- a/src/lingot-config.c +++ b/src/lingot-config.c @@ -25,6 +25,7 @@ #include <stdlib.h> #include <stdio.h> #include <math.h> +#include <locale.h> #include "lingot-config.h" #include "lingot-mainframe.h" @@ -139,6 +140,12 @@ void lingot_config_save(LingotConfig* config, char* filename) { unsigned int i; FILE* fp; + char* lc_all; + + lc_all = setlocale(LC_ALL, NULL); +// duplicate the string, as the next call to setlocale will destroy it + if (lc_all) lc_all = strdup(lc_all); + setlocale(LC_ALL, "POSIX"); if ((fp = fopen(filename, "w")) == NULL) { @@ -166,6 +173,11 @@ void lingot_config_save(LingotConfig* config, char* filename) } fclose(fp); + + if (lc_all) { + setlocale(LC_ALL, lc_all); + free(lc_all); + } } //---------------------------------------------------------------------------- |
