GNU bug report logs - #2878
bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23

Previous Next

Package: emacs;

Reported by: Yee Keat Phuah <ykphuah <at> gmail.com>

Date: Fri, 3 Apr 2009 15:25:05 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Yee Keat Phuah <ykphuah <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: bindat-pack returns unibyte string for emacs 22 but multibyte string 
	for emacs 23
Date: Fri, 3 Apr 2009 23:20:56 +0800
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




This bug report was last modified 16 years and 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.