Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Julian Brown <julian@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH/WIP] C/C++ wchar_t/Unicode printing support
Date: Fri, 16 Jan 2009 00:53:00 -0000	[thread overview]
Message-ID: <m34p00jcpm.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090115221523.28c15971@rex.config> (Julian Brown's message of "Thu\, 15 Jan 2009 22\:15\:23 +0000")

>>>>> "Julian" == Julian Brown <julian@codesourcery.com> writes:

Tom> Perhaps we can invoke "iconv -l" at startup... eww.

Julian> I ran into this problem too. An earlier version of my patch
Julian> had this, in register_iconv_charsets():
[...]
Julian> ...which isn't quite right, but can maybe be adapted into something
Julian> which is.

Nice.

GNU libiconv has the iconvlist function... I wish this were portable.

I suppose we could try that, then popen(iconv -l), and then fall back
to some built-in list.

Tom> Another difference is that I have the intermediate step go through the
Tom> host wchar_t rather than UCS-4.  This is nice because it means we can
Tom> use iswprint to decide if something is printable.  But, it may have
Tom> limitations, I suppose, on a host where wchar_t is less capable.

Julian> I think that might break for recent win32, where wchar_t is
Julian> UTF-16 (i.e.  more than one wide character may be needed for a
Julian> given code point).

I think my current code ought to work ok in this case, assuming that
w32's iswprint returns false for surrogate characters.  In this case
we'll just emit escape codes.

This area is still not ideal, though.  In particular, my current code
only works on hosts that define __STDC_ISO_10646__.  Does w32 define
this?

Hmm, I just thought of a way we can perhaps do better.  I will look at
this a little more.

Tom


  reply	other threads:[~2009-01-16  0:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 20:24 Julian Brown
2009-01-15 21:02 ` Tom Tromey
2009-01-15 21:18   ` Joseph S. Myers
2009-01-16  0:01     ` Tom Tromey
2009-01-15 22:16   ` Julian Brown
2009-01-16  0:53     ` Tom Tromey [this message]
2009-01-16  9:36 ` Eli Zaretskii
2009-01-16 16:18   ` Tom Tromey
2009-01-16 16:40     ` Eli Zaretskii
2009-01-16 16:57       ` Mark Kettenis
2009-01-30  4:11 ` Tom Tromey
2009-01-30 22:14   ` Joel Brobecker
     [not found]     ` <m3ocxos6og.fsf@fleche.redhat.com>
2009-02-01 18:23       ` Daniel Jacobowitz
2009-02-01 22:42         ` Tom Tromey
2009-02-01 23:16           ` Daniel Jacobowitz
2009-02-01 23:18             ` Daniel Jacobowitz
2009-02-01 23:26             ` Tom Tromey
2009-02-03  0:41           ` Joel Brobecker

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=m34p00jcpm.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=julian@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