Moving cursor with keyboard is broken fon non-BMP text
khaledhosny opened this issue · 1 comments
khaledhosny commented
Since we pass UTF-16 text to ICU break iterators, we get back UTF-16 indices (i.e. to positions of non-BMP text) but this is now broken since StoryText
uses UTF-32 now (one position for any Unicode character).
We need to either:
- Pass UTF-32 text to ICU break iterator (which can theoretically be done with
UText
, but ICU does not provide code to createUText
from UTF-32, we need to roll our own solution), or - Map UTF-16 indices back to UTF-32 indices, should be doable by iterating over the UTF-16 text and count any surrogate pair as one character, or
- Switch back to UTF-16 for
StoryText
and deal with other problems in a different way.
Fahad-Alsaidi commented
As Andreas, Craig & I agreed, we switch back to UTF-16 and we will try to deal with other problems in a different way. The old behaviour should now be resumed.