Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes a link has unicode characters in it, such asфайл.zip

If you point your browser to it, it will properly prompt you to download the file as файл.zip. But if you try to do it with wget, the file comes with a mix of ?, percent encoding (like %D0%BB) and the (invalid encoding) string after the filename.

What parameters can I add to wget, or any other command line tricks, so that it behaves as Chrome and Firefox and saves the file exactly as specified in the rendered link - in this case, as файл.zip?

The solution should work without having to explicitly write it in the command, so an explicit wget -O файл.zipфайл.zip is not a good solution.

I realize that as soon as you run wgetфайл.zip it tries to retrieve, that is, it converts the link to percent encoding, which may be the reason why it saves it doesn't render the filename "properly".

I posted a somewhat related question here, whose answer may or may not be of help to this one.

share|improve this question
up vote 2 down vote accepted

You can use curl instead, as follow

curl -Oфайл.zip

It will save it to файл.zip.

share|improve this answer

for wget you can use

wgetфайл.zip --restrict-file-names=nocontrol

if your system can handle utf-8 / other encoding properly.

finally if you still have those % symbols left in your downloaded file , you can use python's urllib.unquote(filename)

share|improve this answer
This should be marked as accepted answer, If the combination of this and everything else people do with wget(e.g. downloading recursively) could be done in curl OP and probably everyone else would have done it already. – Behrooz Jun 15 '15 at 17:57
Can be useful also --restrict-file-names=nocontrol if file link is not final. – ipeacocks Feb 17 at 23:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.