Bug 499337

Summary: kcmutils_generate_desktop_file fails when path has non-ASCII characters in it
Product: [Frameworks and Libraries] frameworks-kcmutils Reporter: ariasuni <aria>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdedev, kdelibs-bugs-null, nicolas.fella
Priority: NOR    
Version First Reported In: 6.10.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description ariasuni 2025-01-30 17:53:47 UTC
SUMMARY
When I try to rebuild the official Arch Linux KWin package (6.2.5) on my machine, I get:

```
[ 78%] Built target kcm_kwin4_genericscripted
Could not open file "/home/ariasuni/dépôts/perso/kwin/src/kwin-6.2.5/src/kcms/compositing/kwincompositing.json"
make[2]: *** [src/kcms/compositing/CMakeFiles/kwincompositing-kcm-desktop-gen.dir/build.make:70: src/kcms/compositing/CMakeFiles/kwincompositing-kcm-desktop-gen] Error 1
make[1]: *** [CMakeFiles/Makefile2:60933: src/kcms/compositing/CMakeFiles/kwincompositing-kcm-desktop-gen.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```

However, it works when I switch to a folder whose path is only ASCII characters.

STEPS TO REPRODUCE
1. Compile KWin in a path with a non-ASCII character, for example `é`

OBSERVED RESULT
A build error.

EXPECTED RESULT
It builds fine.
Comment 1 Bug Janitor Service 2025-02-01 15:44:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcmutils/-/merge_requests/251
Comment 2 Nicolas Fella 2025-02-04 20:50:49 UTC
Git commit d71baa06c8aa880e3c1fb8edd897fb9a720ca55e by Nicolas Fella.
Committed on 04/02/2025 at 20:45.
Pushed by cullmann into branch 'master'.

[kcmmetadatagenerator] Use QCoreApplication to process args

They might contain non-latin1 letters, so using fromLatin1 is
wrong.

QCoreApplication has logic to handle this correctly on all
platforms, so use that

M  +5    -2    tools/kcmmetadatagenerator.cpp

https://invent.kde.org/frameworks/kcmutils/-/commit/d71baa06c8aa880e3c1fb8edd897fb9a720ca55e