Skip to content

Commit

Permalink
skip UTF8 BOM
Browse files Browse the repository at this point in the history
  • Loading branch information
fohristiwhirl committed Apr 21, 2020
1 parent 65091fb commit 7347456
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 60_pgn.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function split_buffer(buf) {
let a = 0;
let b;

if (buf.length > 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191) {
a = 3; // 1st slice will skip byte order mark (BOM).
}

for (b = 0; b < buf.length; b++) {
let ch = buf[b];
if (ch === 10) { // Split on \n
Expand Down

0 comments on commit 7347456

Please sign in to comment.