| 1 |
#!/bin/sh |
| 2 |
# This script checks for Byte Order Marks in source files |
| 3 |
# which in some places may break compilation/runtime of eSpeak NG |
| 4 |
# Look for more at: https://en.wikipedia.org/wiki/Byte_order_mark |
| 5 |
|
| 6 |
echo -n "testing for Byte Order Marks in source files ... " |
| 7 |
|
| 8 |
# TODO checking for other encodings (e.g. UTF-16, UTF-32, UTF-7) needs more elaborate search, |
| 9 |
# otherwise it shows many false positives |
| 10 |
|
| 11 |
cd $(dirname $0)/.. |
| 12 |
grep -ErlI $'\xEF\xBB\xBF' * | grep -v '^build/' | tee tests/bom.check >/dev/null # UTF-8 |
| 13 |
|
| 14 |
if [ -s tests/bom.check ] ; then |
| 15 |
echo "found:" |
| 16 |
cat tests/bom.check |
| 17 |
false |
| 18 |
else |
| 19 |
rm tests/bom.check |
| 20 |
echo "none found" |
| 21 |
true |
| 22 |
fi |