A bit of explaining as to what that %2520
is :
The common space character is encoded as %20
as you noted yourself.
The %
character is encoded as %25
.
The way you get %2520
is when your url already has a %20
in it, and gets urlencoded again, which transforms the %20
to %2520
.
Are you (or any framework you might be using) double encoding characters?
Edit:
Expanding a bit on this, especially for LOCAL links. Assuming you want to link to the resource C:\my path\my file.html
:
%
is a valid filename character and as such it will be encoded) when converting to a proper URL (see next point).file://
protocol, you are basically stating that you have taken all precautions and encoded what needs encoding, the rest should be treated as special characters. In the above example, you should thus provide file:///c:/my%20path/my%20file.html
. Aside from fixing slashes, clients should not encode characters here.NOTES:
/
are used in URLs, reverse slashes \
in Windows paths, but most clients will work with both by converting them to the proper forward slash. file://localhost/c:/my%20path/my%file.html
), but again most clients will work without the host part (ie two slashes only) by assuming you mean the local machine and adding the third slash.