{"id":20145859,"url":"https://github.com/usagi/strip_bom","last_synced_at":"2025-04-09T19:20:31.786Z","repository":{"id":57668904,"uuid":"294524779","full_name":"usagi/strip_bom","owner":"usagi","description":"Add a simple BOM striping feature for `str` and `String`.","archived":false,"fork":false,"pushed_at":"2020-09-10T21:22:21.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T21:11:25.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-10T21:19:22.000Z","updated_at":"2024-10-20T11:40:55.000Z","dependencies_parsed_at":"2022-08-27T03:50:29.586Z","dependency_job_id":null,"html_url":"https://github.com/usagi/strip_bom","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fstrip_bom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fstrip_bom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fstrip_bom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fstrip_bom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usagi","download_url":"https://codeload.github.com/usagi/strip_bom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094991,"owners_count":21046770,"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":[],"created_at":"2024-11-13T22:18:27.428Z","updated_at":"2025-04-09T19:20:31.754Z","avatar_url":"https://github.com/usagi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strip_bom\n\nAdd a simple BOM striping feature for `str` and `String`.\n\n## Usage\n\n```rust\nuse str_strip_bom::*;\n```\n\n```rust\n// Or std::fs::read_to_string, surf::get, ...\nlet my_string: Vec\u003cu8\u003e = vec![ 0xefu8, 0xbb, 0xbf, 0xf0, 0x9f, 0x8d, 0xa3 ];\nlet my_string: String  = String::from_utf8( my_string ).unwrap();\n\n// In this time, my_string has the BOM =\u003e true 🍣\nprintln!( \"{} {}\", my_string.starts_with(\"\\u{feff}\"), \u0026my_string );\n\n// Strip BOM\nlet my_string: \u0026str = my_string.strip_bom();\n\n// my_string (slice) has not the BOM =\u003e false 🍣\nprintln!( \"{} {}\", my_string.starts_with(\"\\u{feff}\"), \u0026my_string );\n```\n\n## Motivation\n\n1. I author wanted **a simple and lightweight BOM stripper for only `str` and `String`**, not for byte stream or the other of UTF-8 such as UTF-16 or UTF-32.\n2. Because, for example, `serde` and `serde_json` has no BOM supporting then it will be fail if I put a UTF-8 BOM source.\n3. The rust standard, `str` and `String`s will not support a BOM stripping features.; See also \u003chttps://github.com/rust-lang/rfcs/issues/2428\u003e.\n\n\n## Reference\n\n- \u003chttps://tools.ietf.org/html/rfc3629\u003e; RFC3269 \"UTF-8, a transformation format of ISO 10646\" §6. Byte order mark (BOM)\n\n## License\n\n- [MIT](LICENSE)\n\n## Author\n\n- USAGI.NETWORK / Usagi Ito \u003chttps://usagi.network\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusagi%2Fstrip_bom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusagi%2Fstrip_bom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusagi%2Fstrip_bom/lists"}