We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2a9c54 commit 2da6a5fCopy full SHA for 2da6a5f
modules/juce_core/native/juce_SystemStats_linux.cpp
@@ -43,10 +43,11 @@ static String getCpuInfo (const char* key)
43
44
static String getLocaleValue (nl_item key)
45
{
46
- auto oldLocale = ::setlocale (LC_ALL, "");
47
- auto result = String::fromUTF8 (nl_langinfo (key));
48
- ::setlocale (LC_ALL, oldLocale);
49
- return result;
+ const String oldLocale { ::setlocale (LC_ALL, nullptr) };
+ const ScopeGuard restore { [oldLocale] { ::setlocale (LC_ALL, oldLocale.toRawUTF8()); } };
+
+ ::setlocale (LC_ALL, ""); // restore locale from env
50
+ return String::fromUTF8 (nl_langinfo (key));
51
}
52
#endif
53
0 commit comments