Use new methods Tools_URL::encodePath or ->htmlAnchor