String.format("Unexpected character '%s' in int_state '%s' " +
"(ext_state '%s')",
HtmlUtils.encodeCharForAscii(input),
currentState.getName(), getState().getName());
currentState = InternalState.INTERNAL_ERROR_STATE;
throw new ParseException(this, errorMsg);
}
if (currentState != nextState) {
nextState = handleExitState(currentState, nextState, input);
}