File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,21 @@ int safe_main(std::function<int(void)> fn) {
44
44
#endif
45
45
try {
46
46
std::locale::global (std::locale (locale));
47
+ if (!std::setlocale (LC_ALL, locale)) {
48
+ std::cerr << " warning: setlocale(LC_ALL, \"\" ) failed\n " ;
49
+ }
47
50
} catch (std::exception const & e) {
48
51
std::cerr << " warning: failed to set user default locale\n " ;
49
52
try {
50
53
std::locale::global (std::locale::classic ());
54
+ if (!std::setlocale (LC_ALL, " C" )) {
55
+ std::cerr << " warning: setlocale(LC_ALL, \" C\" ) failed\n " ;
56
+ }
51
57
} catch (std::exception const & e) {
52
58
std::cerr << " warning: also failed to set classic locale\n " ;
53
59
}
54
60
}
55
61
56
- if (!std::setlocale (LC_ALL, locale)) {
57
- std::cerr << " warning: setlocale(LC_ALL, \"\" ) failed\n " ;
58
- }
59
-
60
62
setup_terminal ();
61
63
62
64
return fn ();
You can’t perform that action at this time.
0 commit comments