Find and strip BOM – Byte Order Mark from files

Use this to find and strip those peskey BOM's from your PHP code:

find -type f |while read file; do if [ "`head -c 3 -- "$file"`" == $'\xef\xbb\xbf' ]; then echo "found BOM in: $file"; sed -i -e 's/\xEF\xBB\xBF//' $file; fi; done
Dette indlæg blev udgivet i Knowledge Base. Bogmærk permalinket.

Skriv et svar