{"html_url": "https://github.com/simonw/sqlite-utils/issues/250#issuecomment-850772428", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/250", "id": 850772428, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MDc3MjQyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-05-29T05:16:02Z", "updated_at": "2021-05-29T05:28:57Z", "author_association": "OWNER", "body": "I needed to find some CSV files on my computer with a BOM at the beginning - I figured out this recipe:\r\n```\r\n% rg -U -E none '^(?-u:\\xEF\\xBB\\xBF)' --glob '*.csv' .\r\n```\r\nTIL here: https://til.simonwillison.net/bash/finding-bom-csv-files-with-ripgrep", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838148087, "label": "Handle byte order marks (BOMs) in CSV files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/250#issuecomment-850771264", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/250", "id": 850771264, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MDc3MTI2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-05-29T05:06:13Z", "updated_at": "2021-05-29T05:06:13Z", "author_association": "OWNER", "body": "The other option is to check if the file starts with `codecs.BOM_UTF8` - which is `b'\\xef\\xbb\\xbf'`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838148087, "label": "Handle byte order marks (BOMs) in CSV files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/250#issuecomment-850771017", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/250", "id": 850771017, "node_id": "MDEyOklzc3VlQ29tbWVudDg1MDc3MTAxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-05-29T05:04:28Z", "updated_at": "2021-05-29T05:04:28Z", "author_association": "OWNER", "body": "https://stackoverflow.com/a/44573867/6083 says:\r\n\r\n> There is no reason to check if a BOM exists or not, utf-8-sig manages that for you and behaves exactly as utf-8 if the BOM does not exist\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 838148087, "label": "Handle byte order marks (BOMs) in CSV files"}, "performed_via_github_app": null}