January 25, 2007

My favorite Firefox Extensions

I've compiled a list of my some of my current favorite extensions for Firefox.

  • Flashblock - Just about everyone already knows about this. I think it was the first Firefox extension I ever installed.
  • Web Developer - If you are in the business this is a must have. It makes it easy to edit CSS and instantly see the changes. Also allows you to disable the cache, view just about everything that's not normally visible on a page (e.g. element class and id names), and has quick access buttons to common functions like "View Source."
  • Colorful Tabs - Changes the tabs' colors. Makes them stand out a little.
  • Live HTTP Headers - Lets you view the HTTP Request and Response headers for a page. Optionally loads in the sidebar so you can watch them in real time.
  • Session Manager - Saves you tabs, current pages, and browsing history when you exit. The next time you start everything goes back to the way you left it.

I have more, but those are the ones I use most often.

Character Sets

It is sometimes easy to forget the importance of character sets when developing web applications. I would venture to guess that many developers don't know how to handle issues such as BiDi text or correctly handle multi-byte characters. I have spent a considerable portion of the last month experimenting with sending Unicode characters to a web browser and I have discovered a few hints and "gotcha's" that I would like to pass along.

  • PHP is pretty much multi-byte handicapped. Period.
  • In Java servlets (and I suppose JSPs) add the preferred character encoding to the Content-type header before getting the PrintWriter from the response. This will set the encoding of the Writer to the charset in the Content-type header. I was doing unnecessarily wrapping OutputStreamWriters around the HttpServletResponse's OutputStream to accomplish this manually. It's so much nicer (and cleaner) to have the underlying implementation do this for you.
  • Since ColdFusion runs in Java, it too automatically determines the character set and encoding to use from the Content-type header if you specify one. To do this use the <cfcontent> tag like this <cfcontent type="text/html; charset=utf-8">.
  • Here's the gotcha with ColdFusion (and JSP perhaps, I haven't tried it): Templates are read using the platform's default character set, Windows-1252 on English Windows systems. The characters are stored internally as UCS-2 (it's Java after all), and encoded using your specified character set before being sent to the output buffer. This can be overridden with the <cfprocessingdirective> tag.