Escape non-http public_ids. Correct escaping of space and -