From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Why does using aset sometimes output raw bytes? Date: Sun, 09 Dec 2018 16:56:02 +0100 Message-ID: <875zw2ofsd.fsf@gmx.net> References: <87h8fmohmo.fsf@gmx.net> <83y38y3exe.fsf@gnu.org> <87d0qaog92.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544370879 29796 195.159.176.226 (9 Dec 2018 15:54:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2018 15:54:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 09 16:54:35 2018 Return-path: Envelope-to: geh-help-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 1gW1Pd-0007dk-OZ for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 16:54:33 +0100 Original-Received: from localhost ([::1]:55814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gW1Rk-00027h-4f for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 10:56:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gW1RD-00027Z-SX for help-gnu-emacs@gnu.org; Sun, 09 Dec 2018 10:56:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gW1RD-0004vy-3W for help-gnu-emacs@gnu.org; Sun, 09 Dec 2018 10:56:11 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:32965) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gW1R8-0004sv-3T; Sun, 09 Dec 2018 10:56:06 -0500 Original-Received: from rosalinde ([88.74.23.82]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M9b4B-1gbksN1lhH-00D28c; Sun, 09 Dec 2018 16:56:04 +0100 In-Reply-To: <87d0qaog92.fsf@gmx.net> (Stephen Berman's message of "Sun, 09 Dec 2018 16:46:01 +0100") X-Provags-ID: V03:K1:LS9AzTQbgverE8WkqSRLU4z3+WE+aPagNfTqKb1G2kak2bw3Bm+ akBjyH7o7k6GMQg7d+7hQCLi5YsLgLzGXz6SIstrEDb/Sv6Vfy56D6VFVboa9QV4MxRd3C9 9qN8AHo0Yjtz/JPNjFDLWPBltFHHAHMPdj4XTDxnY693QQm1j+nN3vLj8YcIwXOMB0oH4K4 O6G9KVIkGmkJoGz5SAOVQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:6ori09XA6GU=:BKQqrP97OF5uP1w4wrbVNw k8t4GV6PDX8aKP5CplH+bp1R2gILVwHFUyWr7ykAr/zji8t+7NgvJIjtbxD/Ys2NAXII7dWWI qa+BIrgyJUv5chGfCsabwyC0OQaUjQ/LvcKWqH0ZJSRMoBeUV3tIyAvAKQV0GV3deX5EA8h74 8O+vjhfEOs97965uhyAc896wMniNsrWHpqw+szFHV9AGqZn6ZeV5q41JmbEmDDLtn5xQEOtiL eznsTxhjuYaVKzjWOjDBczx7ZHSXxXr3qD/X+WIJI7e+Lsx4M+ufvuCKeVsNxHUkdcQUfjMre YeZnmmoKuoGEJahxjPb2kJY0Fufr0PWzp4KfARHZZm0Ygebrsmj53zqYpioGIhBYhjMAEMy+b lbTTafgawEZg0ipROxdj1mSBeOty7YRTcAfFyW4xZ41jes9JNqtiU5N3RzsrimEYvNCffh8em /rIoM++TvDvsFkb5uqkeTY0PRy+nhraJfOxGvgeiydw/PZfY1IMyJF9AWsC6P537S7KbnLb9v UgaqIxY6tUuNpvgxc7+lEj5BP74iAnyCYejWtR1IU2DXkK9fSQmzHzI+IVL+rXfBerBOda1Tr 09Q8akRKQ92O+p2v8v9FHVbyxker7HE08SoI2yn08XwCiYyz9MhYaDwmGxYFRcaLA/MOmIA+c 3jsvJo7KLbqa1z25dE78udk0aDOOVylZm6gBBNU5PCBTS2wur5hOf0ubiP/UDA6DwX+QVdKUi c8Qh2KpOg9/HuGbWDSLU2fOaLvvG/MD+vsPILj9NIPUJ/kxaCXIJ9JAQvReueX4h+xNahRhV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118941 Archived-At: On Sun, 09 Dec 2018 16:46:01 +0100 Stephen Berman = wrote: > On Sun, 09 Dec 2018 17:20:13 +0200 Eli Zaretskii wrote: > >>> Here's what gets inserted into the buffer (I've represented the raw >>> bytes by ascii strings to make sure they're readable here): >>>=20 >>> \344\366\374\337=C5=BF=C3=B0=C4=91=C5=8B >>> =C3=A4=C3=B6=C3=BC=C3=9F=C5=BF=C3=B0=C4=91=C5=8B >>>=20 >>> Is this expected, and if so, what's the explanation, i.e., why does this >>> happen with some non-ascii characters (e.g. =C3=A4=C3=B6=C3=BC=C3=9F) b= ut not with others >>> (e.g =C5=BF=C3=B0=C4=91=C5=8B) and why does it happen when aset gets pa= ssed a variable >>> for the string but not when it gets passed the string itself? >> >> s0 and s2 originally include only pure ASCII characters, so they are >> unibyte strings. Try making them multibyte before using aset. > > Thanks, that works. But why are raw bytes inserted only with some > multibyte strings (e.g. with "=C3=A4=C3=B6=C3=BC=C3=9F" but not with "=C5= =BF=C3=B0=C4=91=C5=8B")? Also, is > there some way to ensure a string is handled as multibyte if it's not > known what characters it contains? E.g., s0 in my example sexp could be > bound to some string by a function call and before applying the function > it is not known if the string is multibyte; is there some way in Lisp to > say "treat the value of s0 as multibyte (regardless of what characters > it contains)"? Also "aous" is also pure ASCII, so why don't raw bytes get inserted with (insert (aset "aous" i (aref "=C3=A4=C3=B6=C3=BC=C3=9F" i)))? Steve Berman