From 259117bad5bb1f735486b9a61708c486530306c4 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 10 Dec 2024 17:13:52 +0100 Subject: [PATCH] Add README.md --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7e07aec --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# valid-utf8 — Filter tool to check whether text is valid UTF-8 or not + +If no file argument is given, valid-utf8 reads from standard input. + +## Build + +`make` + +after building and installing dependencies: + +- [libscstring](https://git.bobpolis.com/bob/libscstring/) + +## Install + +`sudo make install` + +or, on OpenBSD: + +`doas gmake install` + +## Run + +Test a file: + +`valid-utf8 ` + +No output, but exit status will be 0 on success, but 1 if file is not valid +UTF8. + +Use a a filter: + +`echo "some text" | valid-utf8` + +Again, only exit status will indicate validity. + +Find all valid UTF8 files in the current directory, and all directories under +it: + +`find . -exec valid-utf8 "{}" \;` +