[Top][All Lists]

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

Re: Bug with UTF-8 string and dbus

From: Julien Danjou
Subject: Re: Bug with UTF-8 string and dbus
Date: Wed, 09 Jun 2010 08:34:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

On Wed, Jun 09 2010, Eli Zaretskii wrote:

>> > 492                  char *val = SDATA (Fstring_make_unibyte (object));
>> Fstring_make_unibyte is wrong here.
>> Most likely, if the D-Bus specification mandates UTF-8, the better thing
>> to do would be either to encode using utf-8, or to take advantage of the
>> fact that Emacs already uses utf-8 internally and pass just SDATA (object).

According to D-Bus spec[1]:


          UTF-8 string (must be valid UTF-8). Must be nul terminated and
          contain no other nul bytes.

> Using unencoded SDATA would be wrong with eight-bit characters (aka
> raw bytes).  I'd suggest to encode, to be on the safe side.

Any hint on how to do that ?
I mean, I don't know the Emacs C API at all, but I can test some
idea/patch if pointed in the appropriate direction.

[1]  http://dbus.freedesktop.org/doc/dbus-specification.html

Julien Danjou
// ᐰ <address@hidden>   http://julien.danjou.info

Attachment: pgpYfM6qtuULt.pgp
Description: PGP signature

reply via email to

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