пятница, 23 мая 2008 г.

how to remove bom from unicode file

remove the Unicode Byte-Order Mark (BOM) from all your files... to find them on a linux box do the following: find /path/to/editor -type f | while read line; do hd "$line" | grep -q 'ef bb bf' && echo "$line"; done > listOfBOMedFiles.txt to remove them then: cat listOfBOMedFiles.txt | while read line; do dd if=$line of=$line.noBOM ibs=3 skip=1; mv $line.noBOM $line; done

Комментариев нет: