

Beryl/Emerald Themes

Audio/Video/Image/Text/ISO Convert
Nautilus Scripts by marc41 380 comments
Oops... forgot to include a line:
export LANG=C
urldecode() {
arg="$1"
i="0"
while [ "$i" -lt ${#arg} ]; do
c0=${arg:$i:1}
if [ "x$c0" = "x%" ]; then
c1=${arg:$((i+1)):1}
c2=${arg:$((i+2)):1}
printf "\x$c1$c2"
i=$((i+3))
else
echo -n "$c0"
i=$((i+1))
fi
done
} - Feb 09 2012
export LANG=C
urldecode() {
arg="$1"
i="0"
while [ "$i" -lt ${#arg} ]; do
c0=${arg:$i:1}
if [ "x$c0" = "x%" ]; then
c1=${arg:$((i+1)):1}
c2=${arg:$((i+2)):1}
printf "\x$c1$c2"
i=$((i+3))
else
echo -n "$c0"
i=$((i+1))
fi
done
} - Feb 09 2012

Audio/Video/Image/Text/ISO Convert
Nautilus Scripts by marc41 380 comments
If you call this from a nautilus action, nautilus URL encodes the file name and if you have spaces in your file names they become %20, for example: 09%20Love%20Breeds%20Suicide.mp3.
The fix:
1. add this function to the script.
2. modify the use of $1 (3 places near line 1687, 1689 and 1691.
urldecode() {
arg="$1"
i="0"
while [ "$i" -lt ${#arg} ]; do
c0=${arg:$i:1}
if [ "x$c0" = "x%" ]; then
c1=${arg:$((i+1)):1}
c2=${arg:$((i+2)):1}
printf "\x$c1$c2"
i=$((i+3))
else
echo -n "$c0"
i=$((i+1))
fi
done
}
You're welcome. (I apologize for the indentation of the code, BBcode on this site seems to not honor the [code] tag:-)
- Feb 09 2012
The fix:
1. add this function to the script.
2. modify the use of $1 (3 places near line 1687, 1689 and 1691.
urldecode() {
arg="$1"
i="0"
while [ "$i" -lt ${#arg} ]; do
c0=${arg:$i:1}
if [ "x$c0" = "x%" ]; then
c1=${arg:$((i+1)):1}
c2=${arg:$((i+2)):1}
printf "\x$c1$c2"
i=$((i+3))
else
echo -n "$c0"
i=$((i+1))
fi
done
}
You're welcome. (I apologize for the indentation of the code, BBcode on this site seems to not honor the [code] tag:-)
- Feb 09 2012