[PATCH 3/3] [win32] set default locale to "English" in statistics.c

Linus Torvalds torvalds at linux-foundation.org
Sun Nov 6 19:24:06 PST 2011


On Thu, Nov 3, 2011 at 1:44 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>
> sets the default locale to "English" in statistics.c for win32.
> it seems that mingw/GTK outputs xxxxxx, xxxxx characters
> for Day, Month (%a, %b) on a non english locale Windows system
> until 'setlocale(LC_ALL, "English")' is specified.

Quite frankly, instead of doing these odd workarounds for standard
library routines, I'd rather just we stop using strftime entirely.

It's not a complicated routine, and we already have all the support
for it and are already doing it by hand in other places. See
"monthname()" and "weekday()" in main.c and how we do all this
*without* the pain of stupid localization issues in other places.

So please just change the strftime() to a "vsnprintf()" instead, ok?

I'm also a but worried about patch 2/3, since I cannot test it.

                     Linus


More information about the subsurface mailing list