URL to ASCII

I am writing a small script to help me clean out my music (itunes) that has somehow doubled every song. Using the itunes.xml file, I have been able to create a simple list of all the files. The problem is itunes uses URL style formatting, ex. %20 for spaces. I used sed to convert %20 to a space only to find out every special character(!, ?, etc.) is like this. Is there a quick way to convert all URL (hexadecimal I believe) to regular ASCII? Thanks for the help.

Works in bash and ksh:

$ url="Does%20it%20work%3F"
$ printf ${url//%/\\x}

Thanks, that worked great. I hope you can help me out with one more thing. I have a text file that I am trying to filter. Here is part of my script:

while read URL
do
  echo $URL | printf ${URL//%/\\x} > $itunes_file
done < $itunes_file

Before running though the script, the file looks like this:
/Volumes/Diego_External/Music/Jewel/VH-1 Storytellers/06 Who Will Save Your Soul 1.mp3
/Volumes/Diego_External/Music/Jewel/Women & Songs %5BRhino%5D/03 Intuition 1.mp3
After I run it, I get:
/Volumes/Diego_External/Music/Jewel/VH-1

Thanks again.

You can protect the spaces with the double quote:

printf "${URL//%/\\x}"

That fixed it, along with changing to >> not >. Unfortunately, that wasn't the only problem. It still has %5B, %5D, etc that aren't converted with the script. I think at this point, it might be easier to simply search and replace with a text editor. Thanks Ripat.

Well, that's strange. In your shell do this:

$ printf "\x5B"
$ printf "\x5D"

In my bash and ksh it correctly returns [ and ]