Re: [ping] [PATCH] Different outputs affected by locale

Eli Zaretskii
2014-06-12T17:07:49Z

> Date: Thu, 12 Jun 2014 22:37:38 +0800
> From: Yao Qi <yao@codesourcery.com>
> CC: Tom Tromey <tromey@redhat.com>, Joel Brobecker <brobecker@adacore.com>, <gdb-patches@sourceware.org>
>
> GetACP doesn't depend on locale, so I don't think LC_CTYPE=C affects the
> host-charset in GDB.

Indeed, it doesn't.

> However, I do this:
>
> printf ("%d\n", GetACP());
>
> setlocale (LC_CTYPE, "");
> printf ("%d\n", GetACP());
>
> setlocale (LC_CTYPE, "C");
> printf ("%d\n", GetACP());
>
> On my Windows machine, 1252 is printed three times.

As expected: GetACP returns the _default_ codepage, and the default
does not change when you change a locale. And the iswprint function
doesn't consult the default codepage. So I don't think this issue
with GetACP is at all relevant.