Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: ke@alum.bu.edu
Cc: gdb-patches@sourceware.org
Subject: Re: iconv returning byte order marks for Solaris 2.9
Date: Wed, 15 Jul 2009 18:57:00 -0000	[thread overview]
Message-ID: <m34otdiz3t.fsf@fleche.redhat.com> (raw)
In-Reply-To: <71415.13770.qm@web33803.mail.mud.yahoo.com> (Andrew's message of "Wed\, 15 Jul 2009 10\:16\:47 -0700 \(PDT\)")

>>>>> "Andrew" == Andrew  <ke@alum.bu.edu> writes:

Andrew> I found a problem printing strings for gdb 6.8 weekly snapshot 
Andrew> (2009 07 07) on Solaris 2.9. 

Thanks for finding and diagnosing this.

Andrew> I eventually found that changing INTERMEDIATE_ENCODING 
Andrew> in gdb_wchar.h to "UCS-4" and applying the following
Andrew> patch worked. Any comments?

Andrew> I'm not sure how to handle the INTERMEDIATE_ENCODING 
Andrew> change, since it's probably system dependent. 

I don't have access to Solaris.  If I understand correctly, the
situation is:

* wchar_t on Solaris is encoded using UCS-4
* iconv_open accepts "wchar_t" as an encoding name
* in this case, iconv emits a BOM

First, this seems like it must be a Solaris bug, just because I can't
imagine how this would be useful.

I don't think we can use your patch as-is.  It does the BOM elimination
unconditionally, but really I think we can only do it on platforms where
we know that wchar_t is UCS-4 (or UCS-2 I suppose).

Does Solaris 9 support a full suite of conversions?  If not, one option
would be to use libiconv, and find a way to disable most of this code by
default on Solaris.

Failing that, the simplest fix would be if there is an encoding
(compatible with wchar_t) we can use on Solaris which does not insert
the BOM.  For example, maybe "UCS-4BE" or "UCS-4LE", depending on the
architecture.  I think a fix like this could be done entirely in
gdb_wchar.h.  Could you try that?

As far as the host dependency, we can probably just check
__STDC_ISO_10646__.

Tom


  reply	other threads:[~2009-07-15 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 18:28 Andrew
2009-07-15 18:57 ` Tom Tromey [this message]
2009-07-16  2:29   ` Andrew
2009-07-17 19:19     ` Tom Tromey
2009-07-21 20:18       ` Andrew
2009-07-24 21:58         ` Tom Tromey
2009-08-14 20:13         ` 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=m34otdiz3t.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ke@alum.bu.edu \
    /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