CJK language contains more information per character. When people try to
write code to cap the user input by length, ususally it makes more sense
to loose limit for CJK strings. In real life, twitter now also employs
similar algorithm to make tweet length 280 in latin or 140 in CJK characters.
Details
Details
- Reviewers
hein apol - Group Reviewers
Frameworks - Commits
- R244:6758d45cb596: Add a new function to measure the length by text.
unit test.
Diff Detail
Diff Detail
- Repository
- R244 KCoreAddons
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
I'm very happy to see this. I opened a thread about this on k-c-d (I think) last year, but I didn't follow through with actual code. We have various search fields in KDE that do something like "only search on length > 3", and they fail miserably with CJK input. KRunner is one such example.
The algorithm seems decent for now. It can always be refined later, once we have a central API for this.