How to fix file name encoding

character encodingfilenameswget

I scrapped a site with wget.

That site is in German and some of that pages had Ü,ü,Ö,ö,Ä,ä,ß in the URL.

Now some files have a very weird name.
For example one file is called mirror.de/�%9Cbersicht.html

Is there a way to run a command that changes that weird encoding to a proper one?

In the example case I would expect the following as a valid result mirror.de/Uebersicht.html

EDIT:
Output of LC_CTYPE=C ls | grep bersicht.html | od -t x1:

0000000 42 69 6e 61 72 79 20 66 69 6c 65 20 28 73 74 61
0000020 6e 64 61 72 64 20 69 6e 70 75 74 29 20 6d 61 74
0000040 63 68 65 73 0a
0000045

Best Answer

Chances are that if you just decode the %XX URI encodings, you'll get UTF-8 encoded characters. In zsh:

autoload zmv
LC_ALL=C zmv '(**/)(*%*)' '$1${2//(#b)%(??)/${(#):-0x$match}}'

If as noted by Gilles, that � substitution character is for a 0xc3 byte (which in iso8859-1 is a letter which would explain why it hasn't been URI-encoded contrary to 0x9c which is invalid in iso8859-1), then the above command would change your file name to Übersicht.html