From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45342: 28.0.50; Native compiled function returns raw bytes, not string Date: Sun, 20 Dec 2020 20:24:30 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30735"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45342@debbugs.gnu.org To: Alexander Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 20 21:25:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kr5GQ-0007tc-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Dec 2020 21:25:10 +0100 Original-Received: from localhost ([::1]:40708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kr5GP-0004OF-1D for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Dec 2020 15:25:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kr5GI-0004O6-Ls for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2020 15:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kr5GI-0003V4-EO for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2020 15:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kr5GI-0003yX-A0 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2020 15:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2020 20:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45342 X-GNU-PR-Package: emacs Original-Received: via spool by 45342-submit@debbugs.gnu.org id=B45342.160849587415241 (code B ref 45342); Sun, 20 Dec 2020 20:25:02 +0000 Original-Received: (at 45342) by debbugs.gnu.org; 20 Dec 2020 20:24:34 +0000 Original-Received: from localhost ([127.0.0.1]:45680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr5Fq-0003xl-9M for submit@debbugs.gnu.org; Sun, 20 Dec 2020 15:24:34 -0500 Original-Received: from mab.sdf.org ([205.166.94.33]:58192 helo=ma.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr5Fn-0003xc-Rx for 45342@debbugs.gnu.org; Sun, 20 Dec 2020 15:24:32 -0500 Original-Received: from akrl by ma.sdf.org with local (Exim 4.92) (envelope-from ) id 1kr5Fm-00019I-9c; Sun, 20 Dec 2020 20:24:30 +0000 In-Reply-To: (Alexander Miller's message of "Sun, 20 Dec 2020 18:36:46 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196501 Archived-At: Alexander Miller writes: > In my config I have the following function that is used to prettify my > mode-line (the actual version is pure and side-effect-free and inlined, > but that does not seem to have any effect here): > > (defun f (n) > =C2=A0 (pcase n > =C2=A0=C2=A0=C2=A0 (1 " =E2=9E=8A") (2 " =E2=9E=8B") (3 " =E2=9E=8C") (4 = " =E2=9E=8D") (5 " =E2=9E=8E") (6 " =E2=9E=8F") > =C2=A0=C2=A0=C2=A0 (7 " =E2=9E=90") (8 " =E2=9E=91") (9 " =E2=9E=92") (10= " =E2=9E=93") (_ ""))) > > When native compiled it appears to return raw bytes instead of the > unicode symbols, for example I am seeing \342\236\212 instead of =E2=9E= =8A. > > I can circumvent that by using (1 (decode-coding-string " =E2=9E=8A" 'utf= -8)), > but of course that should not be necessary, since there's no such > problem with the byte-compiled version. Hi Alexander, 72c1a41573 fix this for me, would you like to confirm? > And on a probably unrelated note: is it normal for such a simple > function to be compiled to 100 LOC of assembly? That seems surprisingly > to my amateur eyes. Yes, big switch cases is ATM a case we do not generate optimal code for. Thanks for the report! Andrea