Handle spaces and URL-encoded characters in assets

Fixes #1501