0xDECAFBAD

It's all spinning wheels and self-doubt until the first pot of coffee.

Super-fast DummyPants Addressbarlet for del.icio.us

Okay, so lately I've switched to using "addressbarlets" for my del.icio.us posting needs. In particular, I've been using the Super-Fast variety. I cannot stress how much better these are than clicking links in the bookmark toolbar. My del.icio.us posting has converged that much closer to command-line / QuickSilver perfection.

But, I just noticed that in my del.icio.us RSS feed, the title "del.icio.us warning: non-utf8 string! (sorry)" has been popping up--especially on Hot Links, which includes my links on a regular basis.

Well, although I'm not really all that hip to unicode and non-ASCII characters, it appears that things like SmartyPants and the use of chevrons in page titles are throwing the monkey wrench for me when the addressbarlet picks up the document.title. So, I decided to do a little sloppy butchery in my bookmarklet code to wrestle these titles into something acceptable.

After you've had a chance to try out / comprehend the original versions, take a look at this revised addressbarlet:

In case, for some reason, that doesn't come through in this entry, here's the code which should appear in the HREF:

Archived Comments

  • del.icio.us understands UTF-8 (which is exactly what the message says, after all), and the characters you remove are expressed in Unicode codepoints. The disconnect seems to happen when the page you're on is in an encoding other than UTF-8, in which case Firefox apparently escapes characters using their byte values from that encoding in `encodeURIComponent`. I have no idea why, or exactly where this problem happens; the JS docs say the function should always use the UTF-8 representation for the byte values.
  • A very smart improvement of the original - I like it! I'll see if I can't include a link to it, before I forget.