Skip to content

Commit

Permalink
encoding: ensure TextDecoder is only removing utf-8 BOM on `utf-8…
Browse files Browse the repository at this point in the history
…` encoding
  • Loading branch information
phated committed Apr 18, 2022
1 parent bde889b commit d84a4eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/internal/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ function makeTextDecoderJS() {
this[kHandle].write(input);

if (result.length > 0 &&
this[kEncoding] === 'utf-8' &&
!this[kBOMSeen] &&
!(this[kFlags] & CONVERTER_FLAGS_IGNORE_BOM)) {
// If the very first result in the stream is a BOM, and we are not
Expand Down

0 comments on commit d84a4eb

Please sign in to comment.