Bug 505913 - Product name displayed as garbled text for USB devices with non-ASCII characters
Summary: Product name displayed as garbled text for USB devices with non-ASCII characters
Status: RESOLVED FIXED
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.103.0
Platform: Debian stable Linux
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-21 12:32 UTC by gwdx
Modified: 2025-07-03 12:44 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gwdx 2025-06-21 12:32:41 UTC
STEPS TO REPRODUCE
1. Connect a device with a non-ASCII product name (e.g. `一加 Ace 5`) over USB using the MTP protocol.
2. Run: `solid-hardware5 details <device-udi>`

OBSERVED RESULT

Product and description are garbled text.

```
gwd@pc ~ solid-hardware5 details '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2'
udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2'
  parent = '/org/kde/solid/udev' (string)
  vendor = 'OnePlus' (string)
  product = 'ä¸å  Ace 5' (string)
  description = 'ä¸å  Ace 5' (string)
  icon = 'multimedia-player' (string)
  Block.major = 189  (0xbd)  (int)
  Block.minor = 15  (0xf)  (int)
  Block.device = '/dev/bus/usb/001/016' (string)
  Camera.supportedProtocols = {'ptp'} (string list)
  Camera.supportedDrivers = {'gphoto'} (string list)
  PortableMediaPlayer.supportedProtocols = {'mtp'} (string list)
  PortableMediaPlayer.supportedDrivers = {'usb'} (string list)
```

EXPECTED RESULT

Product and description show the correct device name (`一加 Ace 5`).


SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-37-amd64 (64-bit)
Comment 1 Bug Janitor Service 2025-06-21 13:03:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/214
Comment 2 Christoph Cullmann 2025-06-29 15:33:05 UTC
Git commit edae70e96f3459783cd088b636b6044454ffaba6 by Christoph Cullmann, on behalf of Wendi Gan.
Committed on 29/06/2025 at 15:30.
Pushed by cullmann into branch 'master'.

Fix garbled USB device properties

Issue:
When connecting to a USB device with some properties (e.g. product, description, ID_MODEL, ID_SERIAL) containing non-ASCII characters, Solid displays garbled properties.

Change:
Switch from Latin-1 decoding to UTF-8 decoding when reading device properties.

M  +2    -2    src/solid/devices/backends/shared/udevqtdevice.cpp

https://invent.kde.org/frameworks/solid/-/commit/edae70e96f3459783cd088b636b6044454ffaba6