Encoding misc things into object paths

Simon McVittie simon.mcvittie at collabora.co.uk
Sun Jul 20 06:13:56 PDT 2008

On Sun, 20 Jul 2008 at 03:57:59 -0400, Colin Walters wrote:
> On Sat, Jul 19, 2008 at 7:51 AM, Simon McVittie wrote:
> > In Telepathy we deliberately create human-readable strings to make
> > debugging easier. We have a function tp_escape_as_identifier()
> What do you think about putting this into dbus-glib?

I'd be happy to donate it under the MIT/X11 license, but it should be
documented as "as a convenience for debugging; please do not define your
D-Bus API in terms of this function".

It's also worth noting that it's pessimal (the opposite of optimal) for
multilingual text - it will expand each UTF-8 character into at least 6
bytes. When transporting D-Bus over Tubes, we need to convert XMPP chatroom
nicknames into unique bus names, for which we use a much more elaborate
nearly-reversible encoding[1] involving (but not limited to!) Base64.


[1]: reversible up to a certain nickname length, after which it falls back
to truncating what it would have produced and appending a hash of the nickname,
in order to fit into the length limit of a D-Bus name
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080720/7e246c16/attachment.pgp 

More information about the dbus mailing list