Tuesday, August 26, 2008

Safari versus Firefox

Safari is my every-day browser, it just gets better and better.

Firefox is the browser I use for two specific tasks:

1. I prefer to use Firefox for my daily Google Reader session, because it is so easy to turn off advertising. I would not need to do this if adverts in article I read were not so extremely obtrusive. I find it much harder to read when the text is surrounded by strobing adverts for products I have no interest in. So I just turn them off. Sorry for the publishers who need the income but the advertisers are doing you a disservice.

2. I use Firefox for debugging Ajax web applications, using the truely excellent FireBug. Firebug Lite runs in Safari, and it is an incredible acheivement, but it does not hold a torch to the real thing.

Firefox has lots of annoying niggles. The two that I find the worst are:
No obvious access to the system dictionary or spell checker.
Uses option instead of command as the meta-key to open a search or link in a new tab.

(As I said, I am used to Safari)

Anyway, it looks like some of my habits are about to change.
I just downloaded the latest nightly build of WebKit and it blew me away.

Webkit has something very similar to FireBug built into it now, I have not used it heavily yet, but what I have seen looks really promising!!

FireBug can give you some incredibly unuseful error messages sometimes, maybe WebKit will be better.

If you write and debug web applications for a living, I heartily recommend you try out a WebKit nightly, or if not, wait for Safari 4 which has recently been seeded to Apple developers.

Tuesday, August 05, 2008

Number Format Heaven

Well here's a happy ending ....... I have a working solution to this hell.

I did not try any of the solutions I wrote up in the comments of the hell post. I just woke up the next morning realising it was even simpler.

The solution to getting Cocoon and Dojo using the same localised formats for numbers, was to use Java classes that are built using the same CLDR data as Dojo.

I now use the NumberFormat classes from com.ibm.icu.text instead of java.text, to send and receive formatted numbers. It was almost a drop-in replacement.

The IBM versions have their format data compiled from the same source as Dojo. While java.text.*'s data seems to be really stale.

Choose the version that uses the same CLDR version as Dojo.
Dojo 1.1.1 uses CLDR 1.5.1 so wants icu4j version 3.8.1 and Dojo 1.2 will use CLDR 1.6 which comes in icu4j 4.0 (so there is a clear upgrade path).

Here's one happy bunny.

The one remaining fly in the ointment is languages like Hindi and Arabic, that use different Unicode characters for digits, which is really ironic as supposedly zero came from India and the 1 to 9 came from Arabia, (imagine trying to do maths with Roman numerals!!) probably the next thing to try is re-building Dojo's locale number libraries with everything included.