From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: localized strsignal problem Date: Tue, 16 Jun 2009 09:28:41 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1245112145 26265 80.91.229.12 (16 Jun 2009 00:29:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jun 2009 00:29:05 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 16 02:29:02 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MGMXq-00037l-Op for ged-emacs-devel@m.gmane.org; Tue, 16 Jun 2009 02:28:59 +0200 Original-Received: from localhost ([127.0.0.1]:51247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGMXq-0004eP-4N for ged-emacs-devel@m.gmane.org; Mon, 15 Jun 2009 20:28:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGMXk-0004eE-Lh for emacs-devel@gnu.org; Mon, 15 Jun 2009 20:28:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGMXf-0004Z0-Ae for emacs-devel@gnu.org; Mon, 15 Jun 2009 20:28:51 -0400 Original-Received: from [199.232.76.173] (port=55164 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGMXf-0004Yw-3N for emacs-devel@gnu.org; Mon, 15 Jun 2009 20:28:47 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:54615) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGMXe-0000Sx-DK for emacs-devel@gnu.org; Mon, 15 Jun 2009 20:28:46 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n5G0SgZD007262 for ; Tue, 16 Jun 2009 09:28:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n5G0Sg0Q005535 for ; Tue, 16 Jun 2009 09:28:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id n5G0Sfrv018880 for ; Tue, 16 Jun 2009 09:28:41 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MGMXZ-0006Xf-Fl for emacs-devel@gnu.org; Tue, 16 Jun 2009 09:28:41 +0900 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111531 Archived-At: It is reported that this change causes args_out_of_range error in Faset of status_message if strsignal returns a string encoded in some locale encoding. 2009-06-09 Dmitry Dzhus (tiny change) * process.c (status_message): Fix handling of multibyte signal string (Bug#3499). That is because: string = build_string (signame); returns a unibyte string containing 8-bit bytes in non-UTF-8 locale, and Faset can't change the multibuteness of string in such a case. So, I installed the attached patch. But, as I don't have a system whose strsignal returns a localized string, I can't test it. At least, I sent this patch to the above bug reporter and he said that the patch surely fixed the problem. --- Kenichi Handa handa@m17n.org --- process.c.~1.585.~ 2009-06-11 13:54:48.000000000 +0900 +++ process.c 2009-06-15 13:48:57.000000000 +0900 @@ -464,15 +464,24 @@ if (EQ (symbol, Qsignal) || EQ (symbol, Qstop)) { char *signame; - int c; synchronize_system_messages_locale (); signame = strsignal (code); if (signame == 0) - signame = "unknown"; - string = build_string (signame); + string = build_string ("unknown"); + else + { + int c1, c2; + + string = make_unibyte_string (signame, strlen (signame)); + if (! NILP (Vlocale_coding_system)) + string = (code_convert_string_norecord + (string, Vlocale_coding_system, 0)); + c1 = STRING_CHAR ((char *) SDATA (string), 0); + c2 = DOWNCASE (c1); + if (c1 != c2) + Faset (string, 0, make_number (c2)); + } string2 = build_string (coredump ? " (core dumped)\n" : "\n"); - c = STRING_CHAR ((char *) SDATA (string), 0); - Faset (string, 0, make_number (DOWNCASE (c))); return concat2 (string, string2); } else if (EQ (symbol, Qexit))