convert directories and files to utf-8 names
quick and dirty ISO-8859-15 to UTF-8 conversion for old directories and files.
this does not convert the file content or something, only file and directory names
find . -type d -exec sh -c 'i="{}"; mv "$i" "$(echo $i|iconv -f ISO_8859-15)" \
2>/dev/null && echo "moved $(echo $i|iconv -f ISO_8859-15)"' \;
find . -type f -exec sh -c 'i="{}"; mv "$i" "$(echo $i|iconv -f ISO_8859-15)" \
2>/dev/null && echo "moved $(echo $i|iconv -f ISO_8859-15)"' \;
worked fine for my old mp3 library with wrong converted ISO charakters in it.
if you have a lot of subdirectories with chars to convert you could become problems, with converting already encoded directories again. you could do something like that:
I didn’t test it, but it should be working
for i in `seq 0 50 | sort -r -n`; do
find . -type d -exec sh --mindepth=$i -c 'i="{}"; mv "$i" "$(echo $i|iconv -f ISO_8859-15)" \
2>/dev/null && echo "moved $(echo $i|iconv -f ISO_8859-15)"' \;
done
RSS Feed für Kommentare zu diesem Artikel. TrackBack URI
