Bug 494656

Summary: If a folder has the wrong kind of characters, Dolphin can't open or remove or rename it
Product: [Applications] dolphin Reporter: Ellie <el>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kfm-devel
Priority: NOR    
Version First Reported In: 24.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Attached animation that shows what happens when trying to interact with the folder in Dolphin

Description Ellie 2024-10-13 12:41:28 UTC
Created attachment 174769 [details]
Attached animation that shows what happens when trying to interact with the folder in Dolphin

SUMMARY

If a folder has the wrong kind of characters, Dolphin can't open or remove or rename it

STEPS TO REPRODUCE

1. Create a maximum broken file name:

   $ python3
   Python 3.12.7 (main, Oct  7 2024, 07:18:03) [GCC 14.2.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> f = open("/dev/random", "rb")
   >>> s = f.read(64)
   >>> os.mkdir(s)

   (If the generated name has null bytes or forward slashes it might error,
   and you might need to repeat it)

2. Open Dolphin
3. Try to open or rename or delete folder

OBSERVED RESULT

See attached gif. Dolphin can't handle this.

EXPECTED RESULT

Dolphin uses some sort of surrogate encoding for non-Unicode paths so it doesn't ever break down no matter the file name, since the average user will be completely stuck at this point without any obvious options on how to fix this.

SOFTWARE/OS VERSIONS

Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: postmarketOS Edge based on Alpine
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION