diff --git a/dev/findutf8bom.sh b/dev/findutf8bom.sh new file mode 100755 index 00000000000..b7e290fec84 --- /dev/null +++ b/dev/findutf8bom.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Checks if files contains UTF-8 BOM +# in dolibarr source tree excluding +# git repository, custom modules and incuded libraries +# +# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr +grep -rlI \ +--exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' \ +$'\xEF\xBB\xBF' . diff --git a/dev/findutf8bomincludes.sh b/dev/findutf8bomincludes.sh new file mode 100755 index 00000000000..4a9458654d2 --- /dev/null +++ b/dev/findutf8bomincludes.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Checks if files contains UTF-8 BOM +# in dolibarr includes tree excluding +# git repository +# +# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr +grep -rlI \ +--exclude-dir='.git' \ +$'\xEF\xBB\xBF' htdocs/includes diff --git a/dev/removeutf8bom.sh b/dev/removeutf8bom.sh new file mode 100755 index 00000000000..83ae6e68671 --- /dev/null +++ b/dev/removeutf8bom.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Removes UTF-8 BOM from a file list on STDIN +# Use by piping the output of a findutf8bom script +# +# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr +while read f; do + echo "Fixing $f" + sed -i '1s/^\xEF\xBB\xBF//' $f +done