Bug 409132 - Opening a file whose filename has a different encoding fails via click, succeeds via "open with" menu
Summary: Opening a file whose filename has a different encoding fails via click, succe...
Status: RESOLVED NOT A BUG
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.04.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-24 13:27 UTC by rca
Modified: 2019-07-16 09:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rca 2019-06-24 13:27:37 UTC
With Plasma set to e.g. en_US.UTF-8, trying to open a file named "/tmp/lölö.txt" fails when clicking it but succeeds when using the context menu instead. The filename in this case is encoded using ISO-8859-1.


STEPS TO REPRODUCE
1. Have Plasma set to some UTF-8 locale (I'm using en_US.UTF-8)
2. Make sure to also have some ISO-8859-1 locale available (I'm using de_DE.ISO-8859-1)
3. Start a separate Konsole with that locale: LANG=en_US LC_ALL=de_DE.ISO-8859-1 konsole
4. Make sure to set "Encoding" to "8859-1" in "Edit current profile > Advanced"
5. Create a file: echo "test" > /tmp/lölö.txt
6. Make sure the file lists correctly: ls /tmp/lölö.txt
7. Start Dolphin in the same Konsole so it inherits the locale: dolphin /tmp
8. The file will be displayed as "l�l�.txt". (Double) click on the file. Observe the error message above.
9. Right-click the file, select "Open with Kate"


OBSERVED RESULT

The file is not opened when clicked, instead the error appers: "Unable to run the command specified. The file or folder /tmp/l�l�.txt does not exist."

The file is however opened when using the context menu.

EXPECTED RESULT

The file should be opened in both cases, whether through clicking or through the context menu.


SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20190621
KDE Plasma Version: 5.16.0
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.3
Kernel Version: 5.1.7-1-default
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6600K CPU @ 3.50GHz
Memory: 15.6 GiB of RAM


ADDITIONAL INFORMATION

This has been reported on SUSE's Bugzilla already by someone else: https://bugzilla.opensuse.org/show_bug.cgi?id=1134688

But I thought I would bring it upstream since I'm not sure if it might be related to https://bugs.kde.org/show_bug.cgi?id=260677 (as in: there seem to be some differences between how Dolphin folder views, context menus and Konsole handle filename encodings).
Comment 1 Christoph Feck 2019-07-16 09:53:18 UTC
Qt5 unfortunately does no longer support filenames with incorrect encoding. Your locale must be UTF-8 based, and all filenames must use UTF-8 encoding.

Rename the file to fix the encoding error. If you have KF5 version 5.59.0, you will be able to rename the file using Dolphin. If you have an older version, you could either use 'convmv' or any non-Qt5 based file manager.