Add debugging to catch invalid utf8 complaint in check_plain()