InputText: fix search on multi-bytes UTF-8 (#7981)
InputText: fix search on multi-bytes UTF-8 (#7981)

Also fix crashes when text is invalid UTF-8.
poire-z/koreader,koreader/koreader,NiLuJe/koreader,Frenzie/koreader,koreader/koreader,Frenzie/koreader,NiLuJe/koreader,poire-z/koreader