From 72576a26ce54a3fbf8223056587c5b9b419adb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 1 Mar 2013 16:55:07 +0100 Subject: [PATCH] =?UTF-8?q?Added=20UTF-8=20BOM=C2=A0detection=20and=20remo?= =?UTF-8?q?val=20maintenance=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/findutf8bom.sh | 10 ++++++++++ dev/findutf8bomincludes.sh | 10 ++++++++++ dev/removeutf8bom.sh | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100755 dev/findutf8bom.sh create mode 100755 dev/findutf8bomincludes.sh create mode 100755 dev/removeutf8bom.sh 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