If dfaexec() runs in non-UTF8 locales, length and wide character representation are checked for all characters of a line in a input string. However, if matched early in the line, results for remaining characters are wasted. This patch checks multibyte characters on demand. It enables to accomplish to speed-up for matched early and reduce required memories. Norihiro