[Bug] Download dialog does not decode multibyte file name
Describe the bug
File name could not be decoded: %E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6%E5%90%8D%E6%B5%8B%E8%AF%95.txt
How to Reproduce
Download the test file here: https://wwa.lanzoui.com/iz4favlcrne
Expected behavior
Decoded as: 中文文件名测试.txt
Environment
- DDG App Version: 5.124.0
- Device:
- OS: Android 9
Able to reproduce. The download file has the current name. It only is displayed wrong in the app dialog.
Sorry, could you provide more info about how to reproduce this? (e.g: where should I click, etc)


Thank you for the info provided. We are able to reproduce the behaviour you mentioned.
We looked at the headers sent with the request to download the file and noticed the "Content-Disposition" header does not provide an indication that the filename is encoded:
Content-Disposition: attachment; filename= %E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6%E5%90%8D%E6%B5%8B%E8%AF%95.txt
Some browsers choose to do more processing on the filename value, while others don't. For example, when using Firefox I get the downloaded file as "%E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6%E5%90%8D%E6%B5%8B%E8%AF%95.txt", while with Chrome I get "中文文件名测试.txt".
In case of encoded filenames, the "filename*" param should be used as per RFC6266. We don't have support for this at the moment. Once it will be implemented, a header like:
Content-Disposition: attachment; filename*=utf-8''%E4%B8%AD%E6%96%87%E6%96%87%E4%BB%B6%E5%90%8D%E6%B5%8B%E8%AF%95.txt
will give the expected filename. This is a simplified example, there are a number of conditions that go into detecting the name of a file to download.
Asana task (internal only) -> https://app.asana.com/0/1200905986587319/1202994708537217/f
Closing as something we will fix internally.