Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <palves@redhat.com>
Cc: yao@codesourcery.com, tromey@redhat.com, brobecker@adacore.com,
	gdb-patches@sourceware.org
Subject: Re: [ping]  [PATCH] Different outputs affected by locale
Date: Thu, 12 Jun 2014 18:35:00 -0000	[thread overview]
Message-ID: <83egyux9h2.fsf@gnu.org> (raw)
In-Reply-To: <5399EC00.4000601@redhat.com>

> Date: Thu, 12 Jun 2014 19:05:52 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: yao@codesourcery.com, tromey@redhat.com, brobecker@adacore.com,
>         gdb-patches@sourceware.org
> 
> Trying again then.

Thanks.

> The testsuite framework does, in gdb.exp:gdb_init:
> 
>     # We set LC_ALL, LC_CTYPE, and LANG to C so that we get the same
>     # messages as expected.
>     setenv LC_ALL C
>     setenv LC_CTYPE C
>     setenv LANG C
> 
> ... so that output is stable for everyone.

With you so far.  But note that on Windows, even the above does not
guarantee "stable output", because the console codepage is not changed
by 'setlocale', and moreover, the Windows 'setlocale' doesn't pay
attention to environment variables.  So on Windows, these tests run in
the default system locale (because we call 'setlocale' with the 2nd
argument an empty string).

> And if we do that, we miss making sure GDB works correctly
> with locales/charsets other than C/ASCII on most hosts.

And here, "works correctly" means what? sets host-charset? or
something else?  Assuming the former below.

> So I was just saying that IMO ideally we'd have tests that
> make sure GDB prints what we think it should print when
> LC_CTYPE (etc.) is set to something else, like e.g.,
> en_US.UTF-8.

You cannot ask the Windows 'setlocale' to use UTF-8 as the codeset
(although there is a UTF-8 codepage, and Windows does support it in
general).  More importantly, since 'setlocale' on Windows disregards
the environment variables, you cannot change the host charset by
setting environment variables.  You must do that by a GDB command that
sets host-charset.


  reply	other threads:[~2014-06-12 18:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 12:13 Yao Qi
2014-06-04  5:32 ` [ping] " Yao Qi
2014-06-04 12:47   ` Joel Brobecker
2014-06-04 13:21     ` Yao Qi
2014-06-04 13:52       ` Joel Brobecker
2014-06-04 20:15       ` Tom Tromey
2014-06-04 20:23         ` Pedro Alves
2014-06-05  3:31           ` Yao Qi
2014-06-05  8:58             ` Pedro Alves
2014-06-05  9:58               ` Yao Qi
2014-06-05 10:12                 ` Pedro Alves
2014-06-05 15:04                   ` Eli Zaretskii
2014-06-09  8:37                   ` Yao Qi
2014-06-09 10:11                     ` Pedro Alves
2014-06-11  2:22                       ` Yao Qi
2014-06-11 16:23                         ` Eli Zaretskii
2014-06-12  0:48                           ` Yao Qi
2014-06-12  2:47                             ` Eli Zaretskii
2014-06-12  7:04                               ` Yao Qi
2014-06-12 17:03                                 ` Eli Zaretskii
2014-06-17  1:03                                   ` Yao Qi
2014-06-12 11:36                         ` Pedro Alves
2014-06-12 14:39                           ` Yao Qi
2014-06-12 17:07                             ` Eli Zaretskii
2014-06-12 17:23                             ` Pedro Alves
2014-06-12 17:48                               ` Eli Zaretskii
2014-06-17  3:46                               ` Yao Qi
2014-06-17 10:03                                 ` Pedro Alves
2014-06-17 11:39                                   ` Yao Qi
2014-06-12 17:09                           ` Eli Zaretskii
2014-06-12 17:27                             ` Pedro Alves
2014-06-12 17:50                               ` Eli Zaretskii
2014-06-12 18:06                                 ` Pedro Alves
2014-06-12 18:35                                   ` Eli Zaretskii [this message]
2014-06-16 13:58                                     ` Pedro Alves
2014-06-16 15:40                                       ` Eli Zaretskii
2014-06-16 16:23                                         ` Pedro Alves
2014-06-05 10:27                 ` Pedro Alves
2014-06-05 14:47             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83egyux9h2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox