Wednesday, February 20, 2002


Here's a fun [and obvious, if you think about it] tip:

If you turn down the brightness on your laptop's screen, it extends the battery life.
7:13:27 PM  pontificate    


Riddle me this; escaping in xmlrpc

According to the xmlrpc spec and the implementation within Frontier/Radio, you are not supposed to escape anything in a <string></string> typed param or return blocks other than '<' and '&'.

However, every implementation of XMLRPC in a client library that I have run into-- python's xmlrpclib, Mulle Kybernetik's frameworks, and AppleScript's xmlrpc call-- escape a bunch more characters. In every case, the set of characters escaped is different.

So, who is right?

In my case, 'right' is defined by what works in Radio because that is what I'm testing against (and actively using, more or less). The 'extra' characters that were escaped were the source of all the annoying &amp; and ' stuff in the posts.

(Currently on the road: posting this to my weblog at 30,000 feet on the way to Miami. That's one very distinct advantage to Radio-- even when completely disconnected, I can still actively work with my weblog in both an authoring and development role. It is the only reason why RadioServices was written in the first place. I'm sure there are other products capable of this, but $40 and a cactus is good enough for me.)
6:26:42 PM  pontificate    


RadioService v0.9a3 is now ready for download. No new features, just works better-- see previous post regarding encoding of characters. You can pretty much select any hunk of 8 bit content from anything and post it via the service without worry that you'll have to diddle the quotes and other characters in the Radio desktop interface. As the application has all necessary frameworks embedded within, the download jumped from 50k to 280k.

Anyone want to submit a custom Aqua Styled icon for this thing?

(Still haven't fixed the request-caused-app-to-launch-so-it-doesn't-post problem. Not sure what is up with that. Now that the silly character encoding stuff is [hopefully] gone, I'm going to focus on features and tweaks.)
1:05:56 AM  pontificate    


OK-- if this post works, it is because:

  • RadioServices is now using the Mulle Kybernetik frameworks (instead of AppleScript Studio's implementation of xmlrpc).
  • I figured out how to build the frameworks such that they can be included in the app wrapper, but do not have to be copied during development.
  • RadioServices now handles-- does not URL/HTTP encode-- various random bits of punctuation like "'<>'" while also handling escape sequences like <>"'& (these should be rendered as the sequence).
  • RadioServices now logs on console when something bad happens (personally, I would like a little more feedback for services, but this is currently The Apple Way).

The rest of the world is under the impression that more characters than just '&' and '<' should be encoded for string params in XMLRPC. Not so, according to the XMLRPC spec or the Radio UserLand implementation. AppleScript Studio encodes at least the various quotes and the Mulle-Kybernetik framework encoded a lot of things before I patched it. I submitted my patch back to the maintainers. The response was that all of [< > & ' "] should be encoded. This is certainly the behavior of AS Studio, but runs counter to Radio and the Spec (as I interpret it).

If anyone has a clue, please share.

Code has been checked into the repository. I'll try to get a disk image out tomorrow before I'm off to Miami for business.

(geez, I download build 44 of OW and not but five minutes later, build 45 shows up. Thank goodness for a fat pipe.)
12:47:33 AM  pontificate