Skip to content
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

Byte Order Mark should be stripped. #34

Closed
palamccc opened this issue Jun 23, 2014 · 2 comments
Closed

Byte Order Mark should be stripped. #34

palamccc opened this issue Jun 23, 2014 · 2 comments

Comments

@palamccc
Copy link

  • lets say i am concatenating a.js and b.js
  • lets say both have byte order marks in beginning ( some bower packages have BOM on them :-( ).
  • gulp-useref concatenates them with byte order mark in between.
  • This is majorly because fs.readFileSync don't strip BOM fs.readFileSync(filename, 'utf8') doesn't strip BOM markers nodejs/node-v0.x-archive#1918 , and they say developer should strip it if required.
  • so before concatenating BOM should be stripped.
@palamccc palamccc changed the title Byte Order Mark is stripped. Byte Order Mark should be stripped. Jun 23, 2014
@jonkemp
Copy link
Owner

jonkemp commented Jun 26, 2014

One option for you would be to use this module as a workaround.

https://www.npmjs.org/package/strip-bom

It works on streams.

@sindresorhus
Copy link

Yup, it's a good practise to strip the BOM. It's really annoying that Node just can't do it though. As the BOM in UTF8 is useless and only added by stupid Windows tools.

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

No branches or pull requests

3 participants