From unknown Fri Aug 15 17:19:37 2025 X-Loop: don@donarmstrong.com Subject: bug#481: Crashes with non-default language environments Reply-To: Kenichi Handa , 481@debbugs.gnu.org Resent-From: Kenichi Handa Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 25 Jun 2008 03:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 481 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12143626951338 (code B ref -1); Wed, 25 Jun 2008 03:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, IMPRONONCABLE_2,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Jun 2008 02:58:15 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5P2wBgG001332 for ; Tue, 24 Jun 2008 19:58:13 -0700 Received: from mail.gnu.org ([199.232.76.166]:55097 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KBLCt-0004Af-Qr for emacs-pretest-bug@gnu.org; Tue, 24 Jun 2008 22:58:03 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KBLCx-0007Ei-42 for emacs-pretest-bug@gnu.org; Tue, 24 Jun 2008 22:58:10 -0400 Received: from mx1.aist.go.jp ([150.29.246.133]:53100) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KBLCw-0007EH-Ft; Tue, 24 Jun 2008 22:58:07 -0400 Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id m5P2x7b6017572; Wed, 25 Jun 2008 11:59:07 +0900 (JST) env-from (handa@m17n.org) Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id m5P2w4qu029385; Wed, 25 Jun 2008 11:58:04 +0900 (JST) env-from (handa@m17n.org) Received: by smtp3.aist.go.jp with ESMTP id m5P2w3DN008095; Wed, 25 Jun 2008 11:58:03 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1KBLCt-0007B8-RJ; Wed, 25 Jun 2008 11:58:03 +0900 From: Kenichi Handa To: Stefan Monnier CC: juri@jurta.org, emacs-pretest-bug@gnu.org, miles@gnu.org In-reply-to: (message from Stefan Monnier on Tue, 12 Feb 2008 11:29:55 -0500) References: <87y79wve9b.fsf@jurta.org> <87zlu96bp2.fsf@jurta.org> <87prv4l96f.fsf@jurta.org> <87lk5scl3a.fsf@catnip.gol.com> User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Message-Id: Date: Wed, 25 Jun 2008 11:58:03 +0900 X-detected-kernel: by monty-python.gnu.org: Solaris 9 This is the thread of long ago. In article , Stefan Monnier writes: > > But, even if we implement string-to-unibyte, it should be > > used for a string containing only ascii and eight-bit chars. > > And in that case, string-make-unibyte behaves exactly the > > same as string-to-unibyte. > No it would be different: it would also signal an error if some > non-binary char is found. (I might potentially be convinced that it's > OK to additionally accept the 128-255 latin1 chars as alternatives to > eight-bit chars, since they now get character codes 128-255). I've just installed a change to implement string-to-unibyte as below and used it to fix the problem of jpeg detection. (string-to-unibyte string &optional accept-latin-1) Return a unibyte string with the same individual chars as string. If string is unibyte, the result is string itself. Otherwise it is a newly created string, with no text properties, where each `eight-bit' character is converted to the corresponding byte. If string contains a non-ASCII, non-`eight-bit' character, an error is signalled. If the optional 2nd arg accept-latin-1 is non-nil, a Latin-1 character doesn't cause an error, but is converted to a byte of same code. --- Kenichi Handa handa@ni.aist.go.jp