diff --git a/lib/output.js b/lib/output.js index 7bca4dae..72bcdd5e 100644 --- a/lib/output.js +++ b/lib/output.js @@ -86,7 +86,7 @@ function OutputStream(options) { function make_string(str) { var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ + str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0\ufeff]/g, function(s){ switch (s) { case "\\": return "\\\\"; case "\b": return "\\b"; @@ -98,6 +98,7 @@ function OutputStream(options) { case '"': ++dq; return '"'; case "'": ++sq; return "'"; case "\0": return "\\x00"; + case "\ufeff": return "\\ufeff"; } return s; });