DBus API problems & UTF-8

Ross Burton ross at burtonini.com
Mon Jun 12 03:09:59 PDT 2006


On Mon, 2006-06-12 at 12:40 +0300, Kimmo Hämäläinen wrote:
> I mean DBUS_TYPE_STRING. I think the specification should just say
> that
> it's a NUL-terminated sequence of bytes. That way we don't have to
> care
> about encodings, and we don't have to verify UTF-8 in the server
> (there
> is already enough unnecessary O(n) stuff happening in the code...).
> 
> My point is that the DBus specification does not seem to have any
> reason
> for specifying UTF-8 as the encoding -- NUL-terminated byte (save zero
> byte) array would allow for more efficient communication when some
> other
> encoding is used between applications, and the validity check for the
> string data would be left entirely to the applications (where it
> belongs
> -- DBus is just a message bus, it should not inspect the content). 

So if my GTK+ application wants to communicate with a Qt application, I
need to know that the Qt applications are talking in UTF-16 and convert
my strings?

If a Qt application wants to send a message to the message bus itself it
has to change the strings to UTF-8 (assuming the bus itself remains
speaking UTF-8).

Making the validation optional would speed performance, but I don't
fancy having to introspect every client my application talks to just to
find out what encoding they are using, hoping I have access to a codec
for it, and then transforming all of my strings.

Ross
-- 
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





More information about the dbus mailing list