Don't assume that a word of n bytes can match a word of at most n * charset->mbmaxlen bytes, always go for the worst.