Created attachment 122322 [details] Screenshot of the problem SUMMARY When average file size is reported in a tooltip, like "N files, with an average size of X KiB\nY MiB" on a Russian-localized Windows, "KiB" is apparently translated into Russian "КиБ", but, instead of displaying it properly, it's showed as if the text were stored in UTF-8 and read as CP1251, resulting in "РљРёР‘" (which is mojibake). Interestingly, "MiB" does get translated properly into "МиБ". STEPS TO REPRODUCE 1. Install the "latest version" of Filelight for windows from https://utils.kde.org/projects/filelight/ (which is 17.12.0 as of this writing). 2. Run Filelight, point it to a directory with multiple multi-kilobyte files in addition to several larger ones 3. Hover over the dark-red-colored sector, look closely at the tooltip. OBSERVED RESULT Unit for average file size has wrong encoding, while that of total size is OK. EXPECTED RESULT Both units should look properly. SOFTWARE/OS VERSIONS Windows: 7 Starter SP1 32 bit KDE Frameworks Version: 5.37.0 Qt Version: 5.9.1 ADDITIONAL INFORMATION A screenshot is attached.
Git commit 69a707b455739d6acac56a52e1953b9e8b283031 by Christoph Feck. Committed on 21/09/2019 at 12:52. Pushed by cfeck into branch 'Applications/19.08'. Fix encoding of size tooltip in radial map class File (see fileTree.h) internally stores filenames in 8 bit encoding. The size tooltip uses the same API, but does not correctly encode the tooltip to 8 bit. It uses UTF-8, while the system might have a different local encoding. Changing toUtf8() to QFile::encodeName() fixes this. FIXED-IN: 19.08.2 Reviewed by: aacid Differential Revision: https://phabricator.kde.org/D24013 M +1 -1 src/radialMap/map.cpp https://commits.kde.org/filelight/69a707b455739d6acac56a52e1953b9e8b283031