diff options
-rw-r--r-- | lolcat.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -138,7 +138,8 @@ int main(int argc, char** argv) inputs_end = inputs + 1; } - if (force_locale && !strstr(getenv("LANG"), "UTF-8")) + char* env_lang = getenv("LANG"); + if (force_locale && env_lang && !strstr(env_lang, "UTF-8")) setlocale(LC_ALL, "C.UTF-8"); else setlocale(LC_ALL, ""); |