public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: add UTF16/UTF32 target charsets in phony_iconv
Date: Mon, 17 Oct 2022 17:10:55 -0600	[thread overview]
Message-ID: <87v8oicagw.fsf@tromey.com> (raw)
In-Reply-To: <837d105lr4.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 16 Oct 2022 09:24:31 +0300")

>> However, I think there's a better way to fix all this.  It's very simple
>> and offhand I don't know why I didn't think of it before... the use of
>> wchar_t depends on knowing the encoding of wchar_t -- and I think we do
>> know this on mingw, as it's a form of UTF-16.

Eli> Beware: wchar_t on MS-Windows _is_ indeed UTF-16, but that means a
Eli> single wchar_t character can only represent characters within the BMP;
Eli> anything beyond the BMP will need a 'wchar_t *' string whose length is
Eli> at least 2.  So if the code converts single characters, on Windows it
Eli> can only do that with BMP codepoints.

Eli> (Ignore me if what I say makes no sense or is not useful: I wasn't
Eli> tracking this discussion.)

Yes, it is helpful.  This may be an issue with this approach, we'd have
to make sure there is a test that covers this case.  If there is a
problem, I think it's fixable with a bit of work in the
character-printing code, though.

thanks,
Tom

      reply	other threads:[~2022-10-17 23:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 14:00 Patrick Monnerat
2022-10-07 20:10 ` Tom Tromey
2022-10-08  0:12   ` Patrick Monnerat
2022-10-08 18:55     ` Tom Tromey
2022-10-09  0:47       ` Patrick Monnerat
2022-10-10 16:11         ` Tom Tromey
2022-10-16  1:50           ` Tom Tromey
2022-10-16  6:24             ` Eli Zaretskii
2022-10-17 23:10               ` Tom Tromey [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=87v8oicagw.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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).