Skip to content

Commit

Permalink
Don't force C.UTF-8 when locale is UTF-8 already
Browse files Browse the repository at this point in the history
closes #21
  • Loading branch information
m3tav3rse authored and jaseg committed Jun 17, 2019
1 parent 9a928b9 commit abe2bac
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 abe2bac

Please sign in to comment.