diff --git a/src/spellfile.c b/src/spellfile.c index 24df042b764af79a22642b99efe35f044e3609f1..7a3b77660eebae2145b44e7bf19b2d4a5b212032 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -6216,6 +6216,12 @@ spell_add_word( int i; char_u *spf; + if (enc_utf8 && !utf_valid_string(word, NULL)) + { + emsg(_(e_illegal_character_in_word)); + return; + } + if (!valid_spell_word(word, word + len)) { emsg(_(e_illegal_character_in_word));