[openbox] pipe-menus.. character encoding, high ascii and special xml chars

Mike logan at dct.com
Tue Oct 28 19:47:09 EST 2003

On Tuesday, October 28, 2003 at 06:02PM, Ava Arachne Jarvis wrote:
>[Mike - Tue, 28 Oct 2003 04:19:18 PM CST]
>> Strange behavior on the xmlEncodeEntities() and 
>> xmlEncodeEntitiesReentrant()...
>> xmlEncodeEntities() is deprecated in favor of xmlEncodeEntitiesReentrant(), 
>> but they work differently. In 2.5.11, xmlEncodeEntitiesReentrant() doesn't 
>> handle ' or ", and in 1.8.17, it doesn't handle '.
>> Dunno, I'll figure something out.. Maybe just rewrite the function to 
>> handle <>&'" and !isprint()able characters as mentioned earlier. Probably 
>> doesn't make much difference either way.
>Perhaps there's more to it in the documentation, or this is a common
>complaint (I can't imagine it *not* being if there really isn't a way to
>convert between encodings), or there's a workaround, or there's a fix,
>or the documentation at that particular link is out of date... etc.
>This sort of thing can be done in Perl and Python and Ruby, so surely it
>can be done (if in a more burdensome way) in C.  How does obconf or
>openbox source handle it --- particularly obconf, since it must write
>the configuration file?
>It's nice to not reinvent the wheel over and over and over.

Well that's all I can find to it..

Doesn't make much sense to run both functions on a string when you could combine them into one.

I've never used obconf, so I can't say for sure... It may not do any checking on characters right now. Really the only user-defined strings would be workspace names and the theme. Might not be any checking for high ascii or reserved xml characters.

One thing I've been thinking about is a -lobpipemenu, just a bunch of helper functions. That would be better suited to use xml functions to actually build the tree and print the xml. I'm not very familiar with xml, so that would take a little bit.

Those functions could automatically call ob3_string_to_xml_safe(), or whatever the name may be.

I'd find a helper library very handy. Not sure how many people would do 'em in c, but once the c version is done, I'd guess some perl/python modules would be pretty easy to make.

More information about the openbox mailing list