Skip to content

Commit

Permalink
Strip BOM on load
Browse files Browse the repository at this point in the history
  • Loading branch information
joethephish committed Apr 30, 2018
1 parent 524a589 commit 5b73f43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/renderer/inkFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ InkFile.prototype.tryLoadFromDisk = function(loadCallback) {
return;
}

// Strip any BOM
// https://en.wikipedia.org/wiki/Byte_order_mark
data = data.replace(/^\uFEFF/, '');

// Success - fire this callback before other callbacks
// like document change get fired
loadCallback(true);
Expand Down

0 comments on commit 5b73f43

Please sign in to comment.