ISSUE-496: note about character counts ⓟ

note about character counts ⓟ

Raised by:
Addison Phillips
Opened on:

In the introduction there is this note:

For character counts in ranges, what exactly would be counted as a character? Unicode code points? Graphemes?

This is an important distinction. I would suggest that the most commonly needed offset will be either in (a) Unicode code points or (b) in UTF-16 code units.

The latter would be best for JavaScript and DOM access, which are based on UTF-16 and thus would allow direct application of APIs such as substring().

The former would be better from a pure API perspective and for computing things such as string length in "characters".

Grapheme clusters can be complex and, while APIs may wish to find grapheme boundaries or to avoid splitting withing a grapheme , it is rarely the case that API access should be in these terms. Indeed, in some cases, it may be desirable to find text withing a grapheme and not the entire thing.
Related Actions Items:
No related actions
Related emails:
  1. I18N-ISSUE-496: note about character counts ⓟ [find-text] (from on 2015-10-15)

Related notes:

Richard Ishida, 17 Mar 2016, 12:29:03

Display change log ATOM feed

Addison Phillips <>, Chair, Richard Ishida <>, Fuqiao Xue <>, Atsushi Shimono <>, Staff Contacts
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <>.
$Id: index.php,v 1.326 2018/10/13 17:29:51 vivien Exp $