Javadoc
Returns the approximate display width of the character, measured
in units of ascii characters.
This method should err on the side of caution. By default, characters
are assumed to have width 2; this covers CJK ideographs, various
symbols and miscellaneous weird scripts. Given below are some Unicode
ranges for which it seems safe to assume that no character is
substantially wider than an ascii character:
- Latin, extended Latin, even more extended Latin.
- Greek, extended Greek, Cyrillic.
- Some symbols (including currency symbols) and punctuation.
- Half-width Katakana and Hangul.
- Hebrew
- Thai
Characters in these ranges are given a width of 1.
IMPORTANT: this function has an analog in strutil.cc named
UnicodeCharWidth, which needs to be updated if you change the
implementation here.