Re: Escaping strings into GConf keys
Alexander Larsson <[email protected]> Mon, 14 Apr 2003 05:54:45 -0400 (EDT)
| Newsgroups | gmane.comp.gnome.lib.devel |
|---|---|
| Message-ID | <Pine.LNX.4.44.0304140554210.17840-100000@devserv.devel.redhat.com> |
On Fri, 11 Apr 2003, Dave Malcolm wrote:
> (Hopefully I picked an appropriate list for this)
>
> Is there a handy function somewhere to take arbitrary strings and convert
> them into valid GConf keys?
>
> In particular, I wish to have keys named after XML Formal Public Identifiers,
> which can contain slashes, spaces and other punctuation - hence I'd need an
> encode/decode stage to mangle/escape the invalid characters.
>
> If such a feature doesn't exist yet, would you like one? (probably
> implemented as a pair of functions, so that you can losslessly convert in
> both directions)
/* Escape/unescape a string to create a valid key */
char* gconf_escape_key (const char *arbitrary_text,
int len);
char* gconf_unescape_key (const char *escaped_key,
int len);
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson Red Hat, Inc
[email protected] [email protected]
He's a witless shark-wrestling assassin on the edge. She's a cold-hearted
Buddhist hooker from a different time and place. They fight crime!