Add test for correct encoding of already encoded URIs.

The resulting URI should be double-escaped.