Better error message for -futf8

This commit is contained in:
Wolfgang Bumiller 2012-12-22 22:44:14 +01:00
parent ac0ca3de81
commit 2164afb8cf

View file

@ -1430,7 +1430,10 @@ int lex_do(lex_file *lex)
Uchar u8char;
/* check for a valid utf8 character */
if (!OPTS_FLAG(UTF8) || !u8_analyze(lex->tok.value, NULL, NULL, &u8char, 8)) {
if (lexwarn(lex, WARN_MULTIBYTE_CHARACTER, "multibyte character: `%s`", lex->tok.value))
if (lexwarn(lex, WARN_MULTIBYTE_CHARACTER,
( OPTS_FLAG(UTF8) ? "invalid multibyte character sequence `%s`"
: "multibyte character: `%s`" ),
lex->tok.value))
return (lex->tok.ttype = TOKEN_ERROR);
}
else