properly encode id for URI. fixes #22