decode URL before attempting to open them.

Thanks to Chris Pinkham for finding the root cause.

Fixes #11909

(cherry picked from commit cba3bc592f837b4680c2ec8075502b9323bdd3fe)