From unknown Sun Aug 17 09:11:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2878 <2878@debbugs.gnu.org> To: bug#2878 <2878@debbugs.gnu.org> Subject: Status: bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23 Reply-To: bug#2878 <2878@debbugs.gnu.org> Date: Sun, 17 Aug 2025 16:11:13 +0000 retitle 2878 bindat-pack returns unibyte string for emacs 22 but multibyte = string for emacs 23 reassign 2878 emacs submitter 2878 Yee Keat Phuah severity 2878 normal thanks From ykphuah@gmail.com Fri Apr 3 08:21:03 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Apr 2009 15:21:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 n33FL0TO028392 for ; Fri, 3 Apr 2009 08:21:01 -0700 Received: from mx10.gnu.org ([199.232.76.166]:53855) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LplCV-0000mS-P4 for emacs-pretest-bug@gnu.org; Fri, 03 Apr 2009 11:20:59 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LplCV-0005YY-1v for emacs-pretest-bug@gnu.org; Fri, 03 Apr 2009 11:20:59 -0400 Received: from wf-out-1314.google.com ([209.85.200.169]:36954) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LplCU-0005YA-Kc for emacs-pretest-bug@gnu.org; Fri, 03 Apr 2009 11:20:58 -0400 Received: by wf-out-1314.google.com with SMTP id 23so1177742wfg.24 for ; Fri, 03 Apr 2009 08:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=2g05pV+FZCIol6+bjm7shkrdPYywWL/qYDxe1oDO600=; b=F0UIiRwi1kGEDeUC7FWMkoPxxh6y8pzDgaBlEc5huYuSQQnHXGUbX95OghHq0+OPsR ZgGxB3bzRlBlUWxRt72DclQMhfsPNbZCz6hD8X5UYkYdi8QHuPutvnQBz54Y+4uPdGz5 opd0RGJ1VA+ZoXRmnooR6DuE8lMrNOYYq8FVU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=xvQfQ+HjV6i0dLfAxTDICHL9fkRCDhAIvn6nfsvZohEgcq/o7Qc5GF1RAv1NnMSMfK XK3UbbS/x6W2EDHLRKM9S6TZmmYB7H4zMSi8ScfNq/2pgg/gB8+zaGNnLxU6eP3cFJZR 6ofzMeT8fKpyVhgHr3kIn2d2XITf+fy+cJN6o= MIME-Version: 1.0 Received: by 10.142.185.13 with SMTP id i13mr365510wff.36.1238772056391; Fri, 03 Apr 2009 08:20:56 -0700 (PDT) Date: Fri, 3 Apr 2009 23:20:56 +0800 Message-ID: <9caafe030904030820i4dbda89coc97dc2066f8b1a05@mail.gmail.com> Subject: bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23 From: Yee Keat Phuah To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Hi, This piece of code returned nil on emacs 22 and t on emacs 23. (let* ((spec `((:method-id vec 4))) (data `((:ref-type . ,(vector #x00 #x00 #x00 #x00 #x00 #x00 #x00 #x39)) (:method-id . ,(vector #x09 #x90 #xec #xd8)))) (packed (bindat-pack spec data))) (multibyte-string-p packed)) And because of it being multibyte, when i want to send it over the wire to a sub process in a binary data format, it gets transformed and the sub process does not get a byte-by-byte equivalent of the concatenation of the 2 vectors above. I have tried using string-as-unibyte and the effect is still the same. -- Cheers, Phuah Yee Keat From ykphuah@gmail.com Fri Apr 3 09:01:16 2009 Received: (at 2878) by emacsbugs.donarmstrong.com; 3 Apr 2009 16:01:16 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n33G1DgG006886 for <2878@emacsbugs.donarmstrong.com>; Fri, 3 Apr 2009 09:01:14 -0700 Received: by wf-out-1314.google.com with SMTP id 28so1308492wfa.13 for <2878@emacsbugs.donarmstrong.com>; Fri, 03 Apr 2009 09:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=sMZHvR3NbncNLBRxgBIwHQuJwQDZ6FCKKwcIAlyqNuM=; b=wzY8tcZQaYA7vUgAY5A4Vx+ol6KHdIcxQCVcAaHlOEB6DdJ1k5I6IwqYMYu/s5ON+s Llya8YNpBH+sfgPzONQt5uGtsEzokYMdp5rew74wRZcmJzjg4OJx7g3po+R5tknmeu0o UTShQ6chJBuJOihmFr28daaQUAHn8MQ9QUGWM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hM3omjtJPlJXJKFGcuJvkIhVjTilQFtwguuAKedOl+w1K3+xm+djqi4qeTit55g0uV bVmlAUoQTe01ga6durD82YtvGpDzFaIL5EGmjZjlm9OYHr+aZyXSL2/2ZDdM75yTUrgm uDmd2/nuCjFyRURxYRX0ZrNZ9rrhSor5YuNMc= MIME-Version: 1.0 Received: by 10.143.11.11 with SMTP id o11mr367962wfi.193.1238774472911; Fri, 03 Apr 2009 09:01:12 -0700 (PDT) In-Reply-To: References: <9caafe030904030820i4dbda89coc97dc2066f8b1a05@mail.gmail.com> Date: Sat, 4 Apr 2009 00:01:12 +0800 Message-ID: <9caafe030904030901j437c2b01jeaaac516762b6e70@mail.gmail.com> Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) From: Yee Keat Phuah To: 2878@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, snogglethorpe from #emacs have suggested this patch and it worked for my elisp code diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 4843e27..154bffe 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting offset into BINDAT-RAW." (let ((no-return bindat-raw)) (unless bindat-idx (setq bindat-idx 0)) (unless bindat-raw - (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0))) + (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0))) (bindat--pack-group struct spec) - (if no-return nil (concat bindat-raw)))) + (if no-return nil bindat-raw))) On Fri, Apr 3, 2009 at 11:25 PM, Emacs bug Tracking System wrote: > > Thank you for filing a new bug report with Emacs. > > This is an automatically generated reply to let you know your message > has been received. > > Your message is being forwarded to the package maintainers and other > interested parties for their attention; they will reply in due course. > > Your message has been sent to the package maintainer(s): > =A0Emacs Bugs > > If you wish to submit further information on this problem, please > send it to 2878@emacsbugs.donarmstrong.com, as before. > > Please do not send mail to help-debbugs@gnu.org unless you wi= sh > to report a problem with the Bug-tracking system. > > > -- > 2878: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2878 > Emacs Bug Tracking System > Contact help-debbugs@gnu.org with problems > --=20 Cheers, Phuah Yee Keat From cyd@stupidchicken.com Sun May 3 07:49:06 2009 Received: (at 2878) by emacsbugs.donarmstrong.com; 3 May 2009 14:49:06 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n43En3VX020301 for <2878@emacsbugs.donarmstrong.com>; Sun, 3 May 2009 07:49:04 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 60A3E57E246; Sun, 3 May 2009 10:49:09 -0400 (EDT) From: Chong Yidong To: Miles Bader Cc: Yee Keat Phuah , 2878@debbugs.gnu.org Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) Date: Sun, 03 May 2009 10:49:09 -0400 Message-ID: <87preqqm1m.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Miles, could I verify that this patch is correct, and should be checked in? > snogglethorpe from #emacs have suggested this patch and it worked for > my elisp code > --- a/lisp/emacs-lisp/bindat.el > +++ b/lisp/emacs-lisp/bindat.el > @@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting > offset into BINDAT-RAW." > (let ((no-return bindat-raw)) > (unless bindat-idx (setq bindat-idx 0)) > (unless bindat-raw > - (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0))) > + (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0))) > (bindat--pack-group struct spec) > - (if no-return nil (concat bindat-raw)))) > + (if no-return nil bindat-raw))) From snogglethorpe@gmail.com Sun May 3 15:28:27 2009 Received: (at 2878) by emacsbugs.donarmstrong.com; 3 May 2009 22:28:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n43MSN7J028172 for <2878@emacsbugs.donarmstrong.com>; Sun, 3 May 2009 15:28:25 -0700 Received: by qw-out-2122.google.com with SMTP id 5so3246324qwd.13 for <2878@emacsbugs.donarmstrong.com>; Sun, 03 May 2009 15:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=GiHSWSjliwV6EqaKRFnelYtGsRYl7wvXwr1ESkY2Y6c=; b=e2z1c/lKe7dyyhB22rJ+W0gfzPn33dYnIF6EAICjNvINT3aHq3YiI6zf+rAwo66Z2Y vpm2yU6fT4auqRyl9KxCkv+4DpxAKnQCW83KlhZ3VMtJHyV1yZbujhcJr6WCcefk8JcS GBi0T26AHbq3YHIdH8uSEMm8iDEBna3mIru/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Pl8YJfmZHKg9lxQvoIpeiTTUnAP1EkSFVl7+36dxBRdRxDha7aigse6lsz0VVDIy2I Ylgotd+WI0Ix8Q993+Ln5RdSna+6J6Mnk3Hc5H3P7Mz9jfdxb/YEUANrtVnlFoyBut7K gNA5ODsAWukeUM7Hx+6795gs2H6AGDs4oFnPc= MIME-Version: 1.0 Sender: snogglethorpe@gmail.com Received: by 10.229.84.67 with SMTP id i3mr2867680qcl.105.1241389703426; Sun, 03 May 2009 15:28:23 -0700 (PDT) In-Reply-To: <87preqqm1m.fsf@cyd.mit.edu> References: <87preqqm1m.fsf@cyd.mit.edu> Date: Mon, 4 May 2009 07:28:23 +0900 X-Google-Sender-Auth: 711c87ccb15c1a63 Message-ID: Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) From: Miles Bader To: Chong Yidong Cc: Yee Keat Phuah , 2878@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/5/3 Chong Yidong : > Miles, could I verify that this patch is correct, and should be checked > in? > >> snogglethorpe from #emacs have suggested this patch and it worked for >> my elisp code > >> --- a/lisp/emacs-lisp/bindat.el >> +++ b/lisp/emacs-lisp/bindat.el I think it should be checked in. I don't have intimate familiarity with this code, but I did look at the problem and make the patch. The other code in the file stores numerical values into the `bindat-raw' using aset, and then wants to return the whole thing as a unicode string containing those byte values. The old code made a vector, stored into it, and turned the vector into a string using `concat' -- however that ends up making a _multibyte_ string (I don't know whether this is a bug in concat or not). The new method of making a string initially and storing directly into it results in a unibyte string, which is what is desired (this method is also more efficient). -Miles -- Do not taunt Happy Fun Ball. From cyd@stupidchicken.com Sun May 3 18:18:00 2009 Received: (at 2878-done) by emacsbugs.donarmstrong.com; 4 May 2009 01:18:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n441Ht4U011910 for <2878-done@emacsbugs.donarmstrong.com>; Sun, 3 May 2009 18:17:57 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 5C01A57E246; Sun, 3 May 2009 21:18:02 -0400 (EDT) From: Chong Yidong To: Miles Bader Cc: Yee Keat Phuah , 2878-done@debbugs.gnu.org Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) References: <87preqqm1m.fsf@cyd.mit.edu> Date: Sun, 03 May 2009 21:18:02 -0400 In-Reply-To: (Miles Bader's message of "Mon, 4 May 2009 07:28:23 +0900") Message-ID: <87vdohoed1.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Miles Bader writes: > I think it should be checked in. I don't have intimate familiarity > with this code, but I did look at the problem and make the patch. > > The other code in the file stores numerical values into the > `bindat-raw' using aset, and then wants to return the whole thing as a > unicode string containing those byte values. The old code made a > vector, stored into it, and turned the vector into a string using > `concat' -- however that ends up making a _multibyte_ string (I don't > know whether this is a bug in concat or not). The new method of > making a string initially and storing directly into it results in a > unibyte string, which is what is desired (this method is also more > efficient). OK, I've checked in your fix. Thanks. From unknown Sun Aug 17 09:11:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Mon, 01 Jun 2009 14:24:10 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator