Automatically add / strip BOMΒ #3040
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.i18n-apiIssues and PRs related to Node.js internationalization support.Issues and PRs related to Node.js internationalization support.
Description
Activity
- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
on Sep 24, 2015 - addedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Sep 24, 2015 You can use strip-bom or strip-bom-stream, but I agree it would be nice if it were in core.
- addedsemver-majorPRs that contain breaking changes and should be released in the next major version.PRs that contain breaking changes and should be released in the next major version.and removedsemver-majorPRs that contain breaking changes and should be released in the next major version.PRs that contain breaking changes and should be released in the next major version.
on Sep 24, 2015 @sindresorhus
Thank you.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
'\uFEFF' + text/text.replace(/^\uFEFF/, '').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.
Reacted by Akshar A Jamgaonkar- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Sep 24, 2015 - removedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Oct 7, 2015 - addedi18n-apiIssues and PRs related to Node.js internationalization support.Issues and PRs related to Node.js internationalization support.
on Oct 27, 2015 Closing as this can be done easily in userland.
- added 6 commits that reference this issue
on Sep 2, 2017 - added a commit that references this issue
on Sep 6, 2017
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.i18n-apiIssues and PRs related to Node.js internationalization support.Issues and PRs related to Node.js internationalization support.
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?