https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61847
--- Comment #15 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Maybe something like this: Index: open.c =================================================================== --- open.c (revision 212498) +++ open.c (working copy) @@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respect #include "io.h" #include "fbuf.h" #include "unix.h" +#include "locale.h" #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -725,6 +726,10 @@ st_open (st_parameter_open *opp) library_start (&opp->common); + /* For portability, set locale to "POSIX". */ + + setlocale(LC_ALL, "POSIX"); + /* Decode options. */ flags.access = !(cf & IOPARM_OPEN_HAS_ACCESS) ? ACCESS_UNSPECIFIED :