Merge pull request #753 from lcheylus/utf8-ctype

This commit is contained in:
Jakob P. Liljenberg 2024-02-11 17:51:43 +01:00 committed by GitHub
commit 1d62896c9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -936,7 +936,7 @@ int main(int argc, char **argv) {
else {
string found;
bool set_failure{};
for (const auto loc_env : array{"LANG", "LC_ALL"}) {
for (const auto loc_env : array{"LANG", "LC_ALL", "LC_CTYPE"}) {
if (std::getenv(loc_env) != nullptr and str_to_upper(s_replace((string)std::getenv(loc_env), "-", "")).ends_with("UTF8")) {
found = std::getenv(loc_env);
if (std::setlocale(LC_ALL, found.c_str()) == nullptr) {