From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings Date: Thu, 8 Jun 2017 08:56:31 -0700 Organization: UCLA Computer Science Department Message-ID: <2d5a8cd8-0884-bc1e-4298-a84dca61acbf@cs.ucla.edu> References: <29d6844f-2f6f-11c1-7877-a9d169e613f8@cs.ucla.edu> <83tw3s8jhr.fsf@gnu.org> <1c05b888-0c4a-05c8-248a-6e550637fff4@cs.ucla.edu> <8737bbxp6a.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1496937469 28647 195.159.176.226 (8 Jun 2017 15:57:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Jun 2017 15:57:49 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 Cc: v.schneidermann@gmail.com, 27270@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 08 17:57:45 2017 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 1dIzoe-0007CR-JA for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Jun 2017 17:57:44 +0200 Original-Received: from localhost ([::1]:50331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIzok-00082G-0M for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Jun 2017 11:57:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIzo1-0007fH-Kx for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2017 11:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIznz-0001tR-2t for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2017 11:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIzny-0001sx-VI for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2017 11:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dIzny-0001hh-IM for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2017 11:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jun 2017 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27270 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27270-submit@debbugs.gnu.org id=B27270.14969374056522 (code B ref 27270); Thu, 08 Jun 2017 15:57:02 +0000 Original-Received: (at 27270) by debbugs.gnu.org; 8 Jun 2017 15:56:45 +0000 Original-Received: from localhost ([127.0.0.1]:35294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIznh-0001h8-2F for submit@debbugs.gnu.org; Thu, 08 Jun 2017 11:56:45 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIzne-0001gs-Fj for 27270@debbugs.gnu.org; Thu, 08 Jun 2017 11:56:43 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2E6CD1600D1; Thu, 8 Jun 2017 08:56:36 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YsExl9sP8sBM; Thu, 8 Jun 2017 08:56:35 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 752021600D2; Thu, 8 Jun 2017 08:56:35 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ptyYQJNimpdr; Thu, 8 Jun 2017 08:56:35 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1A8E51600D1; Thu, 8 Jun 2017 08:56:35 -0700 (PDT) In-Reply-To: <8737bbxp6a.fsf@users.sourceforge.net> Content-Language: en-US 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:133400 Archived-At: On 06/07/2017 06:07 PM, npostavs@users.sourceforge.net wrote: > display-raw-bytes-as-hex does affect the result display for me (of > course, since the result goes into the buffer), doesn't it for you? Sorry, it didn't when I tried it earlier, but apparently I messed up.=20 Yes, it does affect the display. But this means the problem is even worse than I thought. If I evaluate=20 this in *scratch* in a terminal session running emacs -nw: (setq display-raw-bytes-as-hex t) C-j (format "%c%c" ?\u0090 ?5) C-j Emacs displays this: "\x905" which is the wrong string visually. And if I cut this string out of the=20 terminal window and paste it into another terminal window running Emacs,=20 I'll get "=E0=A4=85" (a string containing the single character U+0905 DEV= ANAGARI=20 LETTER A), which is indeed the wrong string. The string should be=20 displayed unambiguously, either like this: "\x80\ 5" or via some other means. The bottom line is that the visual display of buffers and strings should=20 continue to be unambiguous even when display-raw-bytes-as-hex is t.