On Sunday, 22 October 2017 03:48:12 PDT Christian Ehrlicher wrote: > Hi, > > Is there a Qt-way to decode hex escaped values in a QString? In bug > 61420 the udev filename in /dev/disk/by-label/ is encoded with > ID_FS_LABEL_ENC which means all non-latin1 characters are hex-escaped. > But since QFileInfo::fileName() already returns a QString I can't use > QString::fromUtf8() to do an 'automatic' conversion...
Hmm... I see what you want. First of all, use QStorageInfo. Second, QStorageInfo has the same problem that you're asking about. I tries to guess filesystem labels by looking up the symlink in /dev/disks/by-label that points to the device in question, but it has no decoding function: if (fileInfo.isSymLink() && fileInfo.symLinkTarget() == devicePath) return fileInfo.fileName(); There's no function to decode this in QString or QByteArray for that matter. This has nothing to do with fromUtf8(). The decoding has to be done manually. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest