json: check utf8 before iterating.