It was an almost impossible task in D6 but now with the hook for url_outbound_alter it seems to be the way!
D7 branch still tries to invoke
which is not used anymore.
Instead we should call
Issuefor D6 is fixed in D7 with this.