Bug 395652 - [Windows] Cannot remove brush presets with CJK letters in their filenames
Summary: [Windows] Cannot remove brush presets with CJK letters in their filenames
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: git master (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
: 430448 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-06-20 14:03 UTC by Tyson Tan
Modified: 2021-03-30 13:30 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2018-06-20 14:03:10 UTC
On Windows systems, Krita cannot remove brush presets with CJK letter in their names. Reported by Chinese Krita community. Confirmed on 4.0.4 and Nightly, under freshly installed Windows 7 SP1 and Windows 10 1803, with all Windows Update patches installed.

How to reproduce:
1) Edit Brush Settings >> Save New Brush Preset
2) Input some CJK letters for the new brush preset's name, for example: "测试 (Test for Chinese)", "テスト (Test for Japanese)".
3) Remove the newly created brush preset.
4) Restart Krita.
5) The supposedly removed brush preset returns.

Addtional information:
1) Windows only. Not happening on Linux.
2) Not affecting English named brush presets.
3) I suspect Qt is expecting filename character encoding as UTF-8, but on Windows system, file system is STILL not encoded with Unicode but ANSI. English as ISO-8859-15, Simplified Chinese as GB2312/GB18030/GBK, Japanese as Shift-JIS. It could be that Krita sees mis-interpreted file names through Qt under Windows and failed to delete the preset.
4) I suggest further investigation into this problem, especially where Qt is handing file names.
Comment 1 Jaime Torres 2018-09-24 11:01:14 UTC
Confirmed on windows nightly build.
The brushes are always kept on the filesystem, but they are avoided using a blacklist stored in: .local/share/krita/kis_paintoppresets.blacklist in linux and $User\AppData\Roaming\krita\kis_paintoppresets.blacklist in windows.

While the name of the file is 
<name>~/.local/share/krita/paintoppresets/テスト.kpp</name>
in linux, it becomes:
<name>~/AppData/Roaming/krita/paintoppresets\???.kpp</name>
in windows, while the file has the name:
~/AppData/Roaming/krita/paintoppresets\テスト.kpp (as seen from linux).

Therefore, the brush is not blacklisted.
Comment 2 Halla Rempt 2021-03-30 13:29:30 UTC
This is fixed in master. Tested with 72f75a29c2.
Comment 3 Halla Rempt 2021-03-30 13:30:18 UTC
*** Bug 430448 has been marked as a duplicate of this bug. ***