Skip to content

Commit

Permalink
Don't force C.UTF-8 when locale is UTF-8 already (#22)
Browse files Browse the repository at this point in the history
closes #21
  • Loading branch information
jaseg authored Jun 16, 2019
2 parents 9a928b9 + 9b7e370 commit fa63a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lolcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
Expand Down

0 comments on commit fa63a35

Please sign in to comment.