2024-12-10 17:13:52 +01:00
2024-12-10 17:00:28 +01:00
2024-12-10 17:00:28 +01:00
2024-12-10 17:02:21 +01:00
2024-11-22 15:41:48 +01:00
2024-12-10 17:00:28 +01:00
2024-12-10 17:13:52 +01:00

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:

Install

sudo make install

or, on OpenBSD:

doas gmake install

Run

Test a file:

valid-utf8 <file>

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 "{}" \;

Description
UNIX filter which returns success if text data is valid utf-8, or failure otherwise. Handy for shell scripts or as -exec primary for find.
Readme 44 KiB
Languages
Makefile 59.9%
C++ 40.1%