Visualizando o encoding de arquivos

O comando file com a opção -i retorna o MIME type e MIME encoding para o arquivo informado.

Em conjunto com os comandos find e grep, é bem útil para encontrar encoding incorreto em arquivos.

find ./ -iname '*.php' -type f -exec file -i '{}' \; |
   \ grep -i -v "utf" | sort

Update 06/08/2011: corrigido. Estava faltando o ‘pipe’ antes do grep.

Posts relacionados:

  1. Limpando os logs no Ubuntu

This entry was posted in Genérico and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">