text/plain can also contain invalid utf8 data

so don't test mimetype, but check if it's pure ascii instead

see issue #20191
Merge branch '4.0/pg-invalid-utf8' into 4.0-trunk