GNU bug report logs - #16048
24.3.50; String compare surprise

Previous Next

Package: emacs;

Reported by: michael.albinus <at> gmx.de

Date: Wed, 4 Dec 2013 11:45:03 UTC

Severity: normal

Found in version 24.3.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 16048 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 16048 <at> debbugs.gnu.org
Subject: Re: bug#16048: 24.3.50; String compare surprise
Date: Thu, 05 Dec 2013 20:22:08 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Just to make it clear: Emacs is perfectly capable of holding raw bytes
>> in multibyte strings.  That's why we have the eight-bit charset.
>
> When manipulating sequences of bytes (as opposed to sequences of chars),
> I find it is preferable to use unibyte strings.

We are speaking about functions of dbus.el, which convert a string into
something with a C-style identifier syntax, and back. Nothing I would
expect to be a multibyte string in real life. (Agreed, my example looks
strange, but this is for the hard test in dbus-tests.el)

> Of course, if your string can contain a mix of bytes and chars, you
> don't have a choice.

For the other function in dbus.el, which handles arrays of bytes (often
used to marshall whatever strings are on the wire) I've added earlier
today the possiblity to encode them as unibyte or multibyte. As above,
the function `dbus-byte-array-to-string' cannot decide itself how to
interpret the bytestream, so the caller is requested to decide.

>         Stefan

Best regards, Michael.




This bug report was last modified 11 years and 204 days ago.

Previous Next


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