Composing CJK character requires a lot more key comparing to latin
characters. The raw length check does not make much sense for query string
in CJK characters. Here we use a simple algorithm to query the character
script property in unicode. If they are belong to CJK, use length 2 instead
of 1 for the character.
Details
Details
Search "系" (normally requires three key press "x + i + 1" under pinyin) under
zh_CN in krunner and get some result instead of nothing.
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
runners/services/servicerunner.cpp | ||
---|---|---|
52 | Since there is no 'else', the length is increased by 3 for Han characters. Is this intended? |
runners/services/servicerunner.cpp | ||
---|---|---|
52 | Yeah you're right.. I intended to use else here. |
Comment Actions
I've found this problem in many KDE UIs, and I'd like to have a generic solution. How do you feel about adding something like a logicalStringLength() to KCoreAddons or KCodecs? Then we can use it in KRunner, KMail, Amarok, ...