Re: Escaping strings into GConf keys



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 
                   alexl redhat com    alla lysator liu se 
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! 




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