Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: Iconv / Solaris
Date: Thu, 27 Aug 2009 20:36:00 -0000	[thread overview]
Message-ID: <m3ocq1q9sp.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090827170851.GA25905@caradoc.them.org> (Daniel Jacobowitz's 	message of "Thu, 27 Aug 2009 13:08:51 -0400")

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> On Thu, Aug 27, 2009 at 11:00:41AM -0600, Tom Tromey wrote:
>> Alternatively, you could try using the __sun__ variant and running gdb
>> in a non-UTF-8 locale.  If it works we could go with (a variant of) this
>> approach.

Daniel> What do we look for?  That is, how would I know if it was working or
Daniel> not?  I can easily try an ISO-8859-1 locale, but otherwise I'm a bit
Daniel> out of my depth.

Hmm, good question.

For ISO-8859-1, it is tricky, because that is a subset of UCS-4.

I think you could do a test in other ISO-8859 locales: take a narrow
character not appearing in ISO-8859-1, convert it to a wchar_t using
btowc, and then print the value.  If the value is the same as the UCS-4
value, you probably have UCS-4 wchar_t.

E.g., in ISO-8859-15, 0xA4 is the euro currency sign.  In UCS-4 this is
0x20A0.

The cases I was more concerned about were locales using encodings like
SJIS or EUC.  I'm not sure what wchar_t encoding these might use.

So, I dug through the OpenSolaris source a little and I think UCS-4 is
not always used.  In particular it looks like mbtowc can call:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/euc.multibyte.c#_mbtowc_euc

... which looks like it uses an ad hoc flattened EUC encoding.


The initial problem here is that iconv will not accept "wchar_t" as an
encoding on this platform.  I see we only have one AC_TRY_RUN in gdb
... am I right in assuming that these are not ok?

If they are ok, we can test this at configure time.

If they are not ok, I think we can just add a new setting to
configure.host.  This is simpler to implement.

Tom


  reply	other threads:[~2009-08-27 20:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27  2:22 Daniel Jacobowitz
2009-08-27 17:09 ` Tom Tromey
2009-08-27 17:45   ` Daniel Jacobowitz
2009-08-27 20:36     ` Tom Tromey [this message]
2009-08-27 20:38       ` Daniel Jacobowitz
2009-08-27 20:50         ` Daniel Jacobowitz
2009-08-27 22:03           ` Daniel Jacobowitz
2009-08-28  1:01           ` Tom Tromey
2009-08-28  1:24         ` Tom Tromey
2009-08-28 17:00           ` Tom Tromey

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=m3ocq1q9sp.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --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