01165: Spaces in UNC showing %2520 rather than %20
Description: I'm trying to use the "file:////" to reference a UNC within my network. Spaces in either the path, or the file name are being converted to %2520 rather than %20. For example: file:////serverfoo/foo bar/file.txt will have this as a link: file://serverfoo/foo%2520bar/file.txt. From what I can gather, it seems that a %2520 will show when a space in either a UNC or URl in encoded twice. Enclosing the "file:////" within double brackets "file:////serverfoo/foo bar/file.txt" does not resolved the issue. However, using the double brackets does correctly encode spaces for URLs. Thanks for any help.
* [[file:////serverfoo/foo bar/file.txt]] * [[file:////serverfoo/foo%20bar/file.txt]] * file:////serverfoo/foo%20bar/file.txt
It looks to me that it works fine, and does not encode spaces to %2520. Do you happen to have some local customization that might interfere with this? Also note that most recent browsers will not follow a file:// link from a http:// page. --Petko January 12, 2010, at 01:42 PM
Hi Petko, Hmm... What browser are you using? I'm using IE 7, and your examples, as well as the ones from my description, and tests in the sandbox all show %2520, rather than %20.
Firefox and Konqueror (I don't have a Windows at hand so I cannot test IE7 now). You can also look at the html source of the page. I have no idea why you see %2520, could it come from elsewhere than PmWiki? --Petko January 12, 2010, at 02:46 PM <<<<<<<
Okay, the mystery deepens. Here's the source code from the page. The first example has the file UNC enclosed in double brackets, as does the second example using a URL. The first example shows %2520 in the link, the second shows only the %20 in the link.
Example 1: <p class='vspace'><a class='urllink' href='file:////serverfoo/folderfoo/filefoo%20Q1.pdf' rel='nofollow'>file:////serverfoo/folderfoo/filefoo Q1.pdf</a> </p>
Example 2: <p class='vspace'><a class='externallink' href='[(approve links) edit diff]'>[(approve links) edit diff] le.com</a> </p>
[[file://servername/âçîôû test.txt]] file://servername/âçîôû test.txt
Note that the following characters were incorrectly pasted, "āēīōū", but the space was not encoded, so this test may not mean much
[[file://servername/āēīōū test.txt]] file://servername/āēīōū test.txt
All, Thank you very much, mystery solved. It has to do with the number of forward slashes following "file:" If only two (2) of the forward slashes are used, all is well, and there can be spaces in both the directory names, as well as in the file name. Using four (4) forward slashes breaks the functionality. Once again, PMwiki to the rescue!!!