I think this needs to be

addUtfActionList(matcher, " ", WHITESPACE, NULL, utfType);

and same for the following line.
Otherwise it fails for utf16.  It would be good to retest this whole change with a utf16 file.