summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm3tav3rse <n6maa10816@tuta.io>2019-03-20 23:15:42 +0100
committerjaseg <git@jaseg.net>2019-06-17 11:07:07 +0900
commitabe2bacbf9da389d664ec4dd6df669569ae82efe (patch)
treebb137c7ab8c60ced33b1b0b5c7cd5a38b8c309bb
parent9a928b9ff4795dde86b81d4fbad1baf6026b8c9a (diff)
downloadlolcat-abe2bacbf9da389d664ec4dd6df669569ae82efe.tar.gz
lolcat-abe2bacbf9da389d664ec4dd6df669569ae82efe.tar.bz2
lolcat-abe2bacbf9da389d664ec4dd6df669569ae82efe.zip
Don't force C.UTF-8 when locale is UTF-8 already
closes #21
-rw-r--r--lolcat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lolcat.c b/lolcat.c
index 0788938..c201bbf 100644
--- a/lolcat.c
+++ b/lolcat.c
@@ -138,7 +138,7 @@ int main(int argc, char** argv)
inputs_end = inputs + 1;
}
- if (force_locale)
+ if (force_locale && !strstr(getenv("LANG"), "UTF-8"))
setlocale(LC_ALL, "C.UTF-8");
else
setlocale(LC_ALL, "");