-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
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
Automatically add / strip BOM #3040
Comments
You can use strip-bom or strip-bom-stream, but I agree it would be nice if it were in core. |
@sindresorhus Well, it do seems as a bit excessive way to add / remove just one character... In text2file / file2text single gulping we can as well use For strems to add the whole transform stream in the chain could be as resource consuming as an additional operation in each event handler call. |
Closing as this can be done easily in userland. |
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
fs.readFile* don't strip the BOM header, even when specifying 'utf8' as the encoding, and JSON.parse() doesn't handle it either. There are technically a bunch of BOM indicators, but this is the one seen most commonly and actually appears in a number of package.json files in the wild. See nodejs/node#6924, nodejs/node#3040 for background.
Node does not add or strip BOM when reading or writing utf16le or utf8 files. User must do it manually in all the text IOs.
It is especially inconvenient with streams: for example, in reading huge file line by line, user must check the BOM or some variabe (alreadyStripped) for each line.
Would it be handy to entrust these actions to Node?
The text was updated successfully, but these errors were encountered: