Smarter URL escaping