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

Eli Zaretskii
2014-06-11T16:23:10Z

> Date: Wed, 11 Jun 2014 10:20:28 +0800
> From: Yao Qi <yao@codesourcery.com>
> CC: Tom Tromey <tromey@redhat.com>, Joel Brobecker <brobecker@adacore.com>, <gdb-patches@sourceware.org>
>
> We import setlocale so that we can set locale through env var, assuming
> that different locales affect the return value of iswprint (0xa2).
> However, this assumption isn't true on Windows :(
>
> I write the following program to check the return value of iswprint
> under different locales.
>
> On Linux, the output is reasonable
> $ ./iswprint
> 4
> C: 0
> en_US.UTF-8: 1
> C: 0
>
> On Windows, iswprint always return true!
> C:\>iswprint.win.exe
> 2
> C: 16
> English_United States.1252: 16
> C: 16
>
> iswprint return value depends on LC_CTYPE, but under LC_CTYPE=C,
> iswprint (0xa2) behaves differently on Windows and Linux.

Why do you need 0xa2 to be unprintable?