summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/charset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/charset.c b/lib/charset.c
index 19dfb7e..dabe4b8 100644
--- a/lib/charset.c
+++ b/lib/charset.c
@@ -25,12 +25,16 @@ ZGetCharset(char *charset)
{
char *p;
short retval;
+ static int once = 1;
if (charset == NULL)
charset = getenv("ZEPHYR_CHARSET");
if (charset == NULL) {
- setlocale(LC_ALL, "");
+ if (once) {
+ setlocale(LC_ALL, "");
+ once = 0;
+ }
charset = nl_langinfo(CODESET);
}