From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: FYI: fix Solaris problem with auto host charset
Date: Fri, 17 Apr 2009 23:50:00 -0000 [thread overview]
Message-ID: <m3prfa7sd5.fsf@fleche.redhat.com> (raw)
I'm checking this in.
On some versions of Solaris, nl_langinfo(CODESET) will return "646"
for the C locale. Unfortunately, this value is not then recognized by
iconv_open.
This fixes the problem by recognizing this situation and using "ASCII"
instead. I'm unaware of any other names needing this treatment.
This is a bit of a hack. But, I think such cases should be rare. (My
experience with gcj was that this was the only such case ever
reported.)
Built and regtested on x86-64 (compile farm).
Joel also tested it on an actual Solaris box showing the problem, and
reported improved test results.
Tom
2009-04-17 Tom Tromey <tromey@redhat.com>
* charset.c (_initialize_charset): Add special case for "646".
Index: charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.22
diff -u -r1.22 charset.c
--- charset.c 15 Apr 2009 22:20:30 -0000 1.22
+++ charset.c 17 Apr 2009 23:45:32 -0000
@@ -817,6 +817,10 @@
#ifndef PHONY_ICONV
#ifdef HAVE_LANGINFO_CODESET
auto_host_charset_name = nl_langinfo (CODESET);
+ /* Solaris will return `646' here -- but the Solaris iconv then
+ does not accept this. */
+ if (!strcmp (auto_host_charset_name, "646"))
+ auto_host_charset_name = "ASCII";
target_charset_name = auto_host_charset_name;
set_be_le_names ();
next reply other threads:[~2009-04-17 23:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 23:50 Tom Tromey [this message]
2009-04-18 6:38 ` Eli Zaretskii
2009-04-18 17:12 ` Tom Tromey
2009-04-21 18:53 ` Tom Tromey
2009-04-21 19:06 ` Eli Zaretskii
2009-04-21 19: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=m3prfa7sd5.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