Merge pull request #705 from GPCsolutions/develop-noutf8bomscripts

Added UTF-8 BOM detection and removal maintenance scripts
This commit is contained in:
Laurent Destailleur 2013-03-02 07:02:22 -08:00
commit 519e5dfd48
3 changed files with 30 additions and 0 deletions

10
dev/findutf8bom.sh Executable file
View File

@ -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' .

10
dev/findutf8bomincludes.sh Executable file
View File

@ -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

10
dev/removeutf8bom.sh Executable file
View File

@ -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