I have this:
file://localhost/Volumes/Untitled%20RAID%20Set%201/Callum/iTunes/Music/Steppenwolf/Steppenwolf_%20Gold/1-09%20Magic%20Carpet%20Ride.mp3
It is a location on Mac, its path has been encoded for use in an XML file.
To make this path you can use UrlPathEncode.
But now, I want to put that back to its normal readable path i.e. minus %20 and other characters that are replaced such as acute "e" etc etc etc. Bar the "/" that can easily be changed to "\"
How can you do it with out writing your own "reverser"?
If it comes down to it I will, but I would rather not.
You need to use the opposite of Encode which is of course, Decode.. HttpUtility.UrlDecode:
HttpUtility.UrlDecode("file://localhost/Volumes/Untitled%20RAID%20Set%201/Callum/iTunes/Music/Steppenwolf/Steppenwolf_%20Gold/1-09%20Magic%20Carpet%20Ride.mp3");
Which will return:
file://localhost/Volumes/Untitled RAID Set 1/Callum/iTunes/Music/Steppenwolf/Steppenwolf_ Gold/1-09 Magic Carpet Ride.mp3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With