Check string is UTF8 if(!mb_check_encoding($_POST['MyField'] ?? '', 'UTF-8')) { // reject or convert }