Don't force C.UTF-8 when locale is UTF-8 already

closes #21
This commit is contained in:
m3tav3rse 2019-03-20 23:15:42 +01:00 committed by jaseg
parent 9a928b9ff4
commit abe2bacbf9

View file

@ -138,7 +138,7 @@ int main(int argc, char** argv)
inputs_end = inputs + 1; inputs_end = inputs + 1;
} }
if (force_locale) if (force_locale && !strstr(getenv("LANG"), "UTF-8"))
setlocale(LC_ALL, "C.UTF-8"); setlocale(LC_ALL, "C.UTF-8");
else else
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");