Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I often find sqlite-utils insert ... --csv creates a first column with a weird character at the start of it - which it turns out is the UTF-8 BOM. Fix that.
sqlite-utils insert ... --csv
The text was updated successfully, but these errors were encountered:
https://stackoverflow.com/a/44573867/6083 says:
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
Sorry, something went wrong.
The other option is to check if the file starts with codecs.BOM_UTF8 - which is b'\xef\xbb\xbf'.
codecs.BOM_UTF8
b'\xef\xbb\xbf'
I needed to find some CSV files on my computer with a BOM at the beginning - I figured out this recipe:
% rg -U -E none '^(?-u:\xEF\xBB\xBF)' --glob '*.csv' .
TIL here: https://til.simonwillison.net/bash/finding-bom-csv-files-with-ripgrep
8de5595
Release 3.7
8c542d2
Refs #237, #238, #240, #250, #257, #259, #260
No branches or pull requests
I often find
sqlite-utils insert ... --csv
creates a first column with a weird character at the start of it - which it turns out is the UTF-8 BOM. Fix that.The text was updated successfully, but these errors were encountered: