From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24206: 25.1; Curly quotes generate invalid strings, leading to a segfault Date: Mon, 15 Aug 2016 22:04:18 +0300 Message-ID: <83k2fhg8gd.fsf@gnu.org> References: <8337m7h1dp.fsf@gnu.org> <83zioffew5.fsf@gnu.org> <83popaf1yz.fsf@gnu.org> <87bn0u3rqc.fsf@linux-m68k.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1471288017 4695 195.159.176.226 (15 Aug 2016 19:06:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 Aug 2016 19:06:57 +0000 (UTC) Cc: p.stephani2@gmail.com, johnw@gnu.org, schwab@linux-m68k.org, nicolas@petton.fr, 24206@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 15 21:06:53 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZNDo-0000t5-IT for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Aug 2016 21:06:52 +0200 Original-Received: from localhost ([::1]:38540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNDl-0006t8-OE for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Aug 2016 15:06:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNC4-0005g3-Ld for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2016 15:05:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZNC2-0003KL-Lw for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2016 15:05:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNC2-0003KC-ID for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2016 15:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bZNC2-00040A-Cd for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2016 15:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Aug 2016 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24206 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24206-submit@debbugs.gnu.org id=B24206.147128789715366 (code B ref 24206); Mon, 15 Aug 2016 19:05:02 +0000 Original-Received: (at 24206) by debbugs.gnu.org; 15 Aug 2016 19:04:57 +0000 Original-Received: from localhost ([127.0.0.1]:58557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZNBx-0003zl-CR for submit@debbugs.gnu.org; Mon, 15 Aug 2016 15:04:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZNBu-0003zX-Tx for 24206@debbugs.gnu.org; Mon, 15 Aug 2016 15:04:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZNBo-0003Ho-UT for 24206@debbugs.gnu.org; Mon, 15 Aug 2016 15:04:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNBk-0003H3-Ab; Mon, 15 Aug 2016 15:04:44 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2024 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bZNBf-0005Bj-UG; Mon, 15 Aug 2016 15:04:42 -0400 In-reply-to: (message from Paul Eggert on Mon, 15 Aug 2016 11:43:16 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122254 Archived-At: > Cc: p.stephani2@gmail.com, johnw@gnu.org, nicolas@petton.fr, > 24206@debbugs.gnu.org > From: Paul Eggert > Date: Mon, 15 Aug 2016 11:43:16 -0700 > > Yes. This is in the Elisp manual, which says "We recommend that > you never use unibyte buffers and strings except for manipulating > encoded text or binary non-text data." That advice is for Lisp programmers, so it's only tangentially relevant in this case. > Eli Zaretskii wrote: > > as the original string is > > unibyte, the output of "\200≠", which is multibyte, might not be what > > the users expect. They might expect "\200\342\211\240" instead. > > No, as per Andreas's comment and the Elisp reference manual, users should not > expect substitute-command-keys to do that. We still want them to be as little surprised as possible, do we? > As long as it doesn't crash on non-ASCII unibyte data we needn't > sweat the details about whether it returns unibyte or multibyte > strings for such data. I explained why this cannot be 100% true. So I'd like to avoid converting unibyte strings to multibyte as much as reasonably possible.