From: Mihai Bazon Date: Tue, 5 May 2015 07:11:38 +0000 (+0300) Subject: Only drop the BOM when it's the first character. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e637bdaf4e95ce65c1021f7dda7d198054e99e83;p=UglifyJS.git Only drop the BOM when it's the first character. Close #704 --- diff --git a/lib/parse.js b/lib/parse.js index 53aaabd6..3cc2da51 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -213,7 +213,7 @@ var EX_EOF = {}; function tokenizer($TEXT, filename, html5_comments) { var S = { - text : $TEXT.replace(/\uFEFF/g, ''), + text : $TEXT.replace(/^\uFEFF/g, ''), filename : filename, pos : 0, tokpos : 0,