I finished with my testing and hacking on Blue Fur’s excellent WordPress plugin for sending posts to Identi.ca as status updates. The problems I was having were not with the original code but with WordPress.
The change to get the plugin to work with ur1.ca were pretty straightforward. Thanks to Zach again for providing the initial code I used. I had to make a couple of changes to get it working as I needed, mostly setting a particular CURL option to get the response from ur1.ca where I needed it and a simplification of the XPath expression to get at the shortened URL. My sources have comments pointing out those two changes.
For the weird quote handling problem I was encountering it, it was actually caused by WordPress changing quotes in post titles into cutesy directional quotes. That means a simple " gets changed into a string of characters like “. This isn’t bad, per se, except that the leading ampersand was truncating the post field for the status message. A URL encode fixed that but revealed that Identi.ca is escaping the leading ampersand, making the quote appear as that gobbledy-gook string. That’s the right thing for them to do, escaping user entered text helps foil injection attacks. It was uglying up my status messages, though.
So I added a little function into the plugin to find those named entities and just turn them back into plain ASCII quotes and single quotes. I pass that through a URL encode to avoid the message truncation and now everything appears in Identi.ca as I prefer it.
You can download my version of the plugin, if you like. Blue Fur did not appear to attach a license, neither did I. I provide my changes without condition on re-use but as-is with no warranties.