Add a new function to measure the length by text.

Authored by xuetianweng on Nov 13 2017, 7:11 PM.

Description

Add a new function to measure the length by text.

Summary:
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.

Test Plan: unit test.

Reviewers: hein, apol, Frameworks

Reviewed By: hein

Subscribers: Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D8800

Details

Committed
xuetianwengNov 13 2017, 7:21 PM
Reviewer
hein
Differential Revision
D8800: Add a new function to measure the length by text.
Parents
R244:60e80116809c: Keep widgets optional, as it's a test
Branches
Unknown
Tags
Unknown