File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ x11GraphicsPipe(const std::string &display) :
49
49
display_spec = " :0.0" ;
50
50
}
51
51
52
+ // Store the current locale, so that we can restore it later.
53
+ std::string saved_locale;
54
+ char *saved_locale_p = setlocale (LC_ALL, nullptr );
55
+ if (saved_locale_p != nullptr ) {
56
+ saved_locale = saved_locale_p;
57
+ }
58
+
52
59
// The X docs say we should do this to get international character support
53
60
// from the keyboard.
54
61
setlocale (LC_ALL, " " );
@@ -338,6 +345,11 @@ x11GraphicsPipe(const std::string &display) :
338
345
XFree(im_supported_styles);
339
346
*/
340
347
348
+ // Restore the previous locale.
349
+ if (!saved_locale.empty ()) {
350
+ setlocale (LC_ALL, saved_locale.c_str ());
351
+ }
352
+
341
353
// Get some X atom numbers.
342
354
_wm_delete_window = XInternAtom (_display, " WM_DELETE_WINDOW" , false );
343
355
_net_wm_pid = XInternAtom (_display, " _NET_WM_PID" , false );
You can’t perform that action at this time.
0 commit comments