Files with unicode names sent by http file upload fail to open
Versions
- OS: Debian 10 with KDE
- Gajim version: 1.1.92+gajim@58bb2d25
- GTK version: 3.24.5
- Python-nbxmpp version: 0.9.93
- PyGObject Version: 3.34.
Steps to reproduce the problem
- Receive a file sent by http send with the name 'XT60-M镀金规格书_A.01.1'
- Click the received file link in Gajim to open it
- Press open in the confirmation message box that appears asking whether to open the file
Expected behavior
The pdf file should open with Okular or another PDF viewer, preferably with the default PDF viewer from KDE
Actual behavior
The file fails to open with the following error:
12/24/19 13:59:14 (E) gajim.c.helpers g-io-error-quark: Error when getting information for file “/home/bfs/.local/share/gajim/downloads/XT60-M镀金规格书_A.01.1__055e39203f.pdf”: No such file or directory (1)
Traceback (most recent call last):
File "/home/bfs/apps/gajim/gajim/common/helpers.py", line 1475, in func_wrapper
result = func(self, *args, **kwargs)
File "/home/bfs/apps/gajim/gajim/common/helpers.py", line 1589, in open_file
Gio.AppInfo.launch_default_for_uri(path)
Note: the file gets downloaded into ~/.local/share/gajim/downloads/XT60-F%E9%95%80%E9%87%91%E8%A7%84%E6%A0%BC%E4%B9%A6_A.01.1__5e3b6a7c2c.pdf
I guess that the problem appears because of the unicode characters in the filename not being handled properly.
This problem didn't exist before implementing the new file opening handlers based on mimeapps.list
The content of the mimeapps.list file:
[Default Applications]
x-scheme-handler/mailto=shift-application.desktop
image/bmp=org.kde.gwenview.desktop
image/gif=org.kde.gwenview.desktop
image/jpg=org.kde.gwenview.desktop
image/tiff=org.kde.gwenview.desktop
image/x-bmp=org.kde.gwenview.desktop
image/png=org.kde.gwenview.desktop
application/pdf=org.kde.okular.desktop