madskristensen / BundlerMinifier

Visual Studio extension
Other
615 stars 172 forks source link

Escaped Characters Unescaped Unexpectedly #296

Open lee011 opened 7 years ago

lee011 commented 7 years ago

Installed product versions

Description

Some escaped characters (such as "\ufeff") were unescaped unexpectedly

Steps to recreate

  1. Type some script with escaped characters, example:

    $("#id").html("\ufeff");
  2. Run minifier

Current behavior

After minifying, the escaped characters are unescaped

$("#id").html("");

If the default encoding is not UTF-8, the minified script may contain error because of these unescaped characters, e.g. in Big5:

$("#id").html("嚜?);

Expected behavior

After minifying, the escaped characters are REMAIN ESCAPED, so that the script will not contain any error when saved as any encoding.

marinovdh commented 3 years ago

I got the same situation today (Visual Studio Community 2019 v16.8.3 with BuildBundlerMinifier v3.2.449).

My .css file contains a font-awesome icons like this:

.notification::before {
    content: "\f0f3";
}

After minification it ends up like this:

.notification::before{content:"";}

while I expect it to be:

.notification::before{content:"\f0f3";}

My original file is UTF-8 encoded and so is the created minified file. I cannot find any external cause for this behavior.

Any ideas?