keyman icon indicating copy to clipboard operation
keyman copied to clipboard

bug(core): ldml_processor needs to handle utf-32 items in context 🙀

Open srl295 opened this issue 3 years ago • 0 comments

ldml_processor is likely to slice UTF-32 codepoints into surrogate pairs, such as the character "🙀"

      const std::u16string str = vkeys.lookup(vk, modifier_state);
…
      for(size_t i=0; i<str.length(); i++) {
        // TODO-LDML: needs to be per UTF-32 char? Seems this would push surrogates.
        state->context().push_character(str[i]);
        state->actions().push_character(str[i]);
      }

This should push one utf-32 character, not two surrogate pairs.

Context: found during #7234

#5015

srl295 avatar Oct 07 '22 20:10 srl295