Subject: Re: bug#16048: 24.3.50; String compare surprise

From: Michael Albinus <[email-masked]>
Date: Thu, 05 Dec 2013 20:22:08 +0100

Stefan Monnier <[email-masked]> 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.