diff --git a/src/errors.h b/src/errors.h index dfb6ce644d76bb6baed845b3806137c8d91850ca..34161e01efed7c58d270a59100359041f71eb050 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3273,7 +3273,7 @@ EXTERN char e_illegal_map_mode_string_str[] # if !defined(FEAT_JOB_CHANNEL) EXTERN char e_channel_job_feature_not_available[] INIT(= N_("E1277: Channel and job feature is not available")); -# endif +#endif EXTERN char e_stray_closing_curly_str[] INIT(= N_("E1278: Stray '}' without a matching '{': %s")); EXTERN char e_missing_close_curly_str[] diff --git a/src/spellfile.c b/src/spellfile.c index 24df042b764af79a22642b99efe35f044e3609f1..51f22d7a52d245e88e2931a7286d5a2c1a519167 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));