Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew <ke@alum.bu.edu>
To: gdb-patches@sourceware.org
Subject: Re: iconv returning byte order marks for Solaris 2.9
Date: Thu, 16 Jul 2009 02:29:00 -0000	[thread overview]
Message-ID: <466695.44735.qm@web33802.mail.mud.yahoo.com> (raw)
In-Reply-To: <m34otdiz3t.fsf@fleche.redhat.com>


In the system I'm working iconv_open doesn't accept "wchar_t" as encoding name. It failed when INTERMEDIATE_ENCODING was set to that. 

But setting INTERMEDIATE_ENCODING to "UCS-4BE" eliminated the BOM in the beginning. 

Andrew

--- On Wed, 7/15/09, Tom Tromey <tromey@redhat.com> wrote:

> From: Tom Tromey <tromey@redhat.com>
> Subject: Re: iconv returning byte order marks for Solaris 2.9
> To: ke@alum.bu.edu
> Cc: gdb-patches@sourceware.org
> Date: Wednesday, July 15, 2009, 2:24 PM
> >>>>> "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 19:50 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
2009-07-16  2:29   ` Andrew [this message]
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=466695.44735.qm@web33802.mail.mud.yahoo.com \
    --to=ke@alum.bu.edu \
    --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