bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16048: 24.3.50; String compare surprise


From: Michael Albinus
Subject: bug#16048: 24.3.50; String compare surprise
Date: Thu, 05 Dec 2013 20:22:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <monnier@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]