Revert "don't URL-encode filenames."

This reverts commit b3f4500211d90eb82e7e109401a472651320f49c.
Revert "URL-encode only once."

This reverts commit e929fb7106cdbfb943a852969f8c0abd232ee4fe.
javadoc.
urlencode filename to make sure that filenames work on all platforms.
double urlencode file links since names are already urlencoded.