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
Ü
in UTF-8 in URL encoding is%c3%9c
. What exact byte sequence does the URL consist of (your post has the�
substitution character)? You have a local file now, right? What's the output ofLC_CTYPE=C ls | grep bersicht.html | od -t x1
?Binary file (standard input) matches
. I hadn't thought of that.LC_CTYPE=C ls *bersicht* | od -t x1
orecho *bersicht* | od -t x1
would give useful output. But Stéphane's analysis is probably correct, did you try his answer?