GtkIMContextIME: Avoid committing NULL string
We may get invalid UTF-16 sequences when third party apps or hooks inject WM_CHAR messages. Validate the unicode string before committing.
Fixes https://gitlab.com/inkscape/inkscape/-/issues/2088
Notes:
- It's already that way in GTK4
- IMM stands for Input Method Manager
Edited by Luca Bacci