public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jon Turney <jon.turney@dronecode.org.uk>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Handle encoding failures in Windows thread names
Date: Fri, 03 Jun 2022 08:28:13 +0300	[thread overview]
Message-ID: <83czfqe2oi.fsf@gnu.org> (raw)
In-Reply-To: <b7e0e05d-3005-03ac-bd22-2adc8281d8e5@dronecode.org.uk> (message from Jon Turney on Thu, 2 Jun 2022 20:29:48 +0100)

> Date: Thu, 2 Jun 2022 20:29:48 +0100
> From: Jon Turney <jon.turney@dronecode.org.uk>
> 
> But I think it's not what's wanted in context:  This string ends up 
> being written to stdout, which may be connected to a terminal, which 
> would be expecting that to be encoded for the locale specified by LANG 
> etc, not the Windows codepage.

So we need to convert the terminal's locale to a Windows codepage?
Or maybe calling GetConsoleOutputCP would do the job?

> > Anyway, for Cygwin I think we should replace CP_ACP with CP_UTF8,
> > don't you think?
> 
> That would only be right if LANG etc. specified a UTF8 locale?

I thought Cygwin nowadays used UTF-8 by default?  But I'm far from
being a Cygwin expert, so ignore me if this makes no sense.

      reply	other threads:[~2022-06-03  5:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 14:39 Tom Tromey
2022-04-21 15:47 ` Eli Zaretskii
2022-04-26 18:53   ` Tom Tromey
2022-06-02 14:19 ` Jon Turney
2022-06-02 14:33   ` Tom Tromey
2022-06-02 19:29     ` Jon Turney
2022-06-03 16:19       ` Tom Tromey
2022-06-02 16:07   ` Eli Zaretskii
2022-06-02 19:29     ` Jon Turney
2022-06-03  5:28       ` Eli Zaretskii [this message]

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=83czfqe2oi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jon.turney@dronecode.org.uk \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).