properly encode links with special chars