Skip to content

Automatically add / strip BOMΒ #3040

Description

@vsemozhetbyt

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?

Activity

  1. added
    fsIssues and PRs related to file-system APIs and the fs module.
    on Sep 24, 2015
  2. added
    questionIssues asking questions about Node.js.
    on Sep 24, 2015
  3. sindresorhus commented on Sep 24, 2015

    @sindresorhus

    You can use strip-bom or strip-bom-stream, but I agree it would be nice if it were in core.

  4. added
    semver-majorPRs that contain breaking changes and should be released in the next major version.
    and removed
    semver-majorPRs that contain breaking changes and should be released in the next major version.
    on Sep 24, 2015
  5. vsemozhetbyt commented on Sep 24, 2015

    @vsemozhetbyt
    ContributorAuthor

    @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.

  6. added
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Oct 27, 2015
  7. evanlucas commented on Jan 19, 2016

    @evanlucas
    Contributor

    Closing as this can be done easily in userland.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.i18n-apiIssues and PRs related to Node.js internationalization support.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions