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