From: Daniel Jacobowitz <drow@mvista.com>
To: Jim Blandy <jimb@redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFC] Character set support
Date: Fri, 13 Sep 2002 10:33:00 -0000 [thread overview]
Message-ID: <20020913173351.GA25544@nevyn.them.org> (raw)
In-Reply-To: <vt2n0qlvn4q.fsf@zenia.red-bean.com>
On Fri, Sep 13, 2002 at 12:02:29PM -0500, Jim Blandy wrote:
>
> Daniel Jacobowitz <drow@mvista.com> writes:
> > I'm not suggesting reading wchar_t's from the target; that's not
> > terribly useful a thing to do. You _want_ the host wchar_t. It is
> > a host type capable of holding a wide character; the type changes
> > based on platform and on whether or not the platform actually has
> > wide character support.
>
> If you're suggesting using the host's wchar_t to hold characters after
> conversion from the target charset to the host charset, then I'm with
> you.
>
> If you're suggesting using the host's wchar_t to hold character values
> that have been read from the target, but not yet converted to the
> host's charset, then I really disagree. The target's wchar_t could be
> 32 bits, while the host's might be 16 bits.
Precisely. I was suggesting using host wchar_t after conversion to
host format.
> > There's not much you can do if it doesn't, is there?
>
> Print things in hex? When the target->host conversion fails, you
> can't just drop the character, but you still need some way to
> represent the pre-conversion value in GDB.
>
> > Rather than using iconv, which is meant for converting strings of
> > text, it seemed to me when I wrote the above comments that we should
> > be using mbrtowc/wctomb functions. However, unlike iconv, they
> > appear to operate based on the current locale rather than a
> > specified charset. I suppose they are unsuitable and we'll have to
> > figure out how to use iconv appropriately.
>
> Yes, exactly. If mbrtowc were parameterized with the charset, it
> would work pretty well.
Yeah. Maybe there's some way we can get the same effect. It would be
really nice to be able to handle target-wchar_t variables and figure
out what character they're supposed to be! The only standard way to do
this seems to be:
The behaviour of mbsrtowcs depends on the LC_CTYPE category of
the current locale.
and that would be too ridiculously slow.
I guess iconv is the way to go, then.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-09-13 17:33 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-12 17:31 Kevin Buettner
2002-09-12 17:41 ` Daniel Jacobowitz
2002-09-12 20:24 ` Jim Blandy
2002-09-12 20:45 ` Andrew Cagney
2002-09-13 10:05 ` Jim Blandy
2002-09-13 11:39 ` Andrew Cagney
2002-09-13 19:06 ` Jim Blandy
2002-09-16 22:25 ` Andrew Cagney
2002-09-19 12:52 ` Jim Blandy
2002-09-19 13:27 ` Kevin Buettner
2002-09-20 13:49 ` Eli Zaretskii
2002-09-13 7:02 ` Daniel Jacobowitz
2002-09-13 10:16 ` Jim Blandy
2002-09-13 10:33 ` Daniel Jacobowitz [this message]
2002-09-13 11:42 ` Andrew Cagney
2002-09-13 12:11 ` Kevin Buettner
2002-09-13 12:15 ` Daniel Jacobowitz
2002-09-12 17:53 ` Andrew Cagney
2002-09-12 18:08 ` Kevin Buettner
2002-09-19 17:36 ` Kevin Buettner
2002-09-19 17:46 ` Kevin Buettner
2002-09-19 18:12 ` Andrew Cagney
2002-09-20 0:12 ` Kevin Buettner
2002-09-20 9:08 ` Andrew Cagney
2002-09-20 14:58 ` Kevin Buettner
2002-09-20 16:33 ` Andrew Cagney
2002-09-21 1:26 ` Eli Zaretskii
2002-09-20 16:55 ` Kevin Buettner
2002-09-20 8:59 ` Eli Zaretskii
2002-09-20 17:34 ` Kevin Buettner
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=20020913173351.GA25544@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
--cc=kevinb@redhat.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