{"id":18300111,"url":"https://github.com/archiecobbs/bom","last_synced_at":"2025-04-09T09:25:44.701Z","repository":{"id":145406728,"uuid":"417213171","full_name":"archiecobbs/bom","owner":"archiecobbs","description":"Deals with Unicode byte order marks","archived":false,"fork":false,"pushed_at":"2021-11-04T16:12:53.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T03:29:58.917Z","etag":null,"topics":["unicode","utf"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/archiecobbs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-14T16:56:04.000Z","updated_at":"2024-05-25T03:44:47.000Z","dependencies_parsed_at":"2023-06-03T17:15:35.190Z","dependency_job_id":null,"html_url":"https://github.com/archiecobbs/bom","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archiecobbs%2Fbom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archiecobbs%2Fbom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archiecobbs%2Fbom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archiecobbs%2Fbom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archiecobbs","download_url":"https://codeload.github.com/archiecobbs/bom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248010313,"owners_count":21032881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["unicode","utf"],"created_at":"2024-11-05T15:11:25.422Z","updated_at":"2025-04-09T09:25:44.681Z","avatar_url":"https://github.com/archiecobbs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"**bom** is a simple UNIX command line utility for dealing with Unicode byte order marks (BOM's).\n\nUnicode byte order marks are \"magic number\" byte sequences that sometimes appear at the beginning of a file to indicate the file's character encoding. They're sometimes helpful but usually they're just annoying.\n\nYou can read more about byte order marks [here](https://en.wikipedia.org/wiki/Byte_order_mark).\n\n**bom** operates in one of the following modes:\n\n  * `bom --detect` Detect which type of byte order mark is present (if any) and print to standard output\n  * `bom --strip` Strip off the byte order mark (if any) and output the remainder of the file, optionally also converting to UTF-8\n  * `bom --print` Output the byte sequence corresponding to a byte order mark (useful for adding them to files)\n  * `bom --list` List the supported byte order mark types\n\nHere is the man page:\n```\nBOM(1)                      BSD General Commands Manual                      BOM(1)\n\nNAME\n     bom -- Decode Unicode byte order mark\n\nSYNOPSIS\n     bom --strip [--expect types] [--lenient] [--prefer32] [--utf8] [file]\n     bom --detect [--expect types] [--prefer32] [file]\n     bom --print type\n     bom --list\n     bom --help\n     bom --version\n\nDESCRIPTION\n     bom decodes, verifies, reports, and/or strips the byte order mark (BOM) at the\n     start of the specified file, if any.\n\n     When no file is specified, or when file is -, read standard input.\n\nOPTIONS\n     -d, --detect\n             Report the detected BOM type to standard output and then exit.\n\n             See SUPPORTED BOM TYPES for possible values.\n\n     -e, --expect types\n             Expect to find one of the specified BOM types, otherwise exit with an\n             error.\n\n             Multiple types may be specified, separated by commas.\n\n             Specifying NONE is acceptable and matches when the file has no (sup-\n             ported) BOM.\n\n     -h, --help\n             Output command line usage help.\n\n     -l, --lenient\n             Silently ignore any illegal byte sequences encountered when converting\n             the remainder of the file to UTF-8.\n\n             Without this flag, bom will exit immediately with an error if an ille-\n             gal byte sequence is encountered.\n\n             This flag has no effect unless the --utf8 flag is given.\n\n     --list  List the supported BOM types and exit.\n\n     -p, --print type\n             Output the byte sequence corresponding to the type byte order mark.\n\n     --prefer32\n             Used to disambiguate the byte sequence FF FE 00 00, which can be\n             either a UTF-32LE BOM or a UTF-16LE BOM followed by a NUL character.\n\n             Without this flag, UTF-16LE is assumed; with this flag, UTF-32LE is\n             assumed.\n\n     -s, --strip\n             Strip the BOM, if any, from the beginning of the file and output the\n             remainder of the file.\n\n     -u, --utf8\n             Convert the remainder of the file to UTF-8, assuming the character\n             encoding implied by the detected BOM.\n\n             For files with no (supported) BOM, this flag has no effect and the\n             remainder of the file is copied unmodified.\n\n             For files with a UTF-8 BOM, the identity transformation is still\n             applied, so (for example) illegal byte sequences will be detected.\n\n     -v, --version\n             Output program version and exit.\n\nSUPPORTED BOM TYPES\n     The supported BOM types are:\n\n     NONE    No supported BOM was detected.\n\n     UTF-7   A UTF-7 BOM was detected.\n\n     UTF-8   A UTF-8 BOM was detected.\n\n     UTF-16BE\n             A UTF-16 (Big Endian) BOM was detected.\n\n     UTF-16LE\n             A UTF-16 (Little Endian) BOM was detected.\n\n     UTF-32BE\n             A UTF-32 (Big Endian) BOM was detected.\n\n     UTF-32LE\n             A UTF-32 (Little Endian) BOM was detected.\n\n     GB18030\n             A GB18030 (Chinese National Standard) BOM was detected.\n\nEXAMPLES\n     To tell what kind of byte order mark a file has:\n\n           $ bom --detect\n\n     To normalize files with byte order marks into UTF-8, and pass other files\n     through unchanged:\n\n           $ bom --strip --utf8\n\n     Same as previous example, but discard illegal byte sequences instead of gener-\n     ating an error:\n\n           $ bom --strip --utf8 --lenient\n\n     To verify a properly encoded UTF-8 or UTF-16 file with a byte-order-mark and\n     output it as UTF-8:\n\n           $ bom --strip --utf8 --expect UTF-8,UTF-16LE,UTF-16BE\n\n     To just remove any byte order mark and get on with your life:\n\n           $ bom --strip file\n\nRETURN VALUES\n     bom exits with one of the following values:\n\n     0       Success.\n\n     1       A general error occurred.\n\n     2       The --expect flag was given but the detected BOM did not match.\n\n     3       An illegal byte sequence was detected (and --lenient was not speci-\n             fied).\n\nSEE ALSO\n     iconv(1)\n\n     bom: Decode Unicode byte order mark, https://github.com/archiecobbs/bom.\n\nAUTHOR\n     Archie L. Cobbs \u003carchie.cobbs@gmail.com\u003e\n\nBSD                               October 14, 2021                              BSD\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchiecobbs%2Fbom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchiecobbs%2Fbom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchiecobbs%2Fbom/lists"}