From 57d0d76053ddb96a2957528cf02288c768b62ca1 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sun, 6 Mar 2022 02:28:17 +0900 Subject: [PATCH] misc: add scripts for handling BOM Signed-off-by: Masatake YAMATO --- misc/addbom | 7 +++++++ misc/hasbom | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 misc/addbom create mode 100755 misc/hasbom diff --git a/misc/addbom b/misc/addbom new file mode 100644 index 0000000000..7d52b390a3 --- /dev/null +++ b/misc/addbom @@ -0,0 +1,7 @@ +#!/bin/sh +e=/bin/echo + +$e -ne '\xef' +$e -ne '\xbb' +$e -ne '\xbf' +cat $1 diff --git a/misc/hasbom b/misc/hasbom new file mode 100755 index 0000000000..27c8a77913 --- /dev/null +++ b/misc/hasbom @@ -0,0 +1,2 @@ +#!/bin/sh +test "$(od --endian=big -x -A n -N 3 $1)" = " efbb bf00"