Examples how search UTF8 with BOM and not UTF8 files


Search php files in UTF8 with BOM encoding
grep -rl --include=*.php $'\xEF\xBB\xBF' .

Search NOT UTF8 php files
find ./ -type f -iname "*.php" | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail