Simple library for dealing with UTF-8 BOM (Byte Order Mark)

Piotr Czajkowski 4f0822eb70 Be consistent %!s(int64=4) %!d(string=hai) anos
.github 37b6c14153 Create main.yml %!s(int64=4) %!d(string=hai) anos
.gitignore f6b70503dd Added bomToolkit %!s(int64=7) %!d(string=hai) anos
LICENSE.md eda3d65bad License %!s(int64=6) %!d(string=hai) anos
README.md 2d800ca762 No Windows %!s(int64=4) %!d(string=hai) anos
bom.c 4f0822eb70 Be consistent %!s(int64=4) %!d(string=hai) anos
bom.h 3a5b10a653 Additional error checking %!s(int64=4) %!d(string=hai) anos
bomToolkit.c e1cf7b80fb Maybe a bit cleaner %!s(int64=4) %!d(string=hai) anos
makefile 2d800ca762 No Windows %!s(int64=4) %!d(string=hai) anos
testBOM daf7382543 First version %!s(int64=7) %!d(string=hai) anos
testNoBOM daf7382543 First version %!s(int64=7) %!d(string=hai) anos
test_bom.c 7eabf2a642 Better errors, I hope %!s(int64=5) %!d(string=hai) anos

README.md

BOM

I've written it for fun and because BOM is still a valid problem in l10n world. It's simple and relies only on standard libraries, so should work pretty much everywhere.

It contains simple test which you can run by:

make test

I've also added simple wrapper, so you can use it as executable:

Usage:
./bomToolkit <filePath> c - to check for BOM.
./bomToolkit <filePath> r - to remove BOM.
./bomToolkit <filePath> a - to add BOM.

It's 22 times faster than similar one I've written in C#, so either C is faster at that or I've written it better:) Enjoy!

As always, you can use it as you want, but I give you no warranty.