Skip to content Skip to sidebar Skip to footer

Grunt And Uglifyjs In Windows App Development - Utf8 Problems

I'm developing a Windows 8/8.1 JavaScript app. It basicallly is a port of our webapp. For deployment, I'm using grunt, grunt-contrib-uglify and grunt-contrib-cssmin (next to some m

Solution 1:

I had a similar problem, though a lot of circumstances were diff't, so not sure if solution will work for you.

Uglify unescapes and converts \u0000 and other unicode chars in regexps to utf-8.

Try executing uglify with the options ascii-only=true and beautify=false

more discussion at this uglify issue

Solution 2:

My guess is that it is your Windows loading with the wrong charset. Did you set the charset in your html page so that it would force the browser to load it using UTF-8?

It seems to be a problem with how your files is being loaded instead of how they are generated/minified.

Link: http://www.w3.org/International/questions/qa-html-encoding-declarations

<html><head><metahttp-equiv="Content-Type"content="text/html; charset=utf-8"></head><body></body></html>

Solution 3:

The Problem really seems to be the combination of uglify merged files and BOM. My current setup minifies each JS file but doesn't merge them anymore (there's no need to, as the Windows app will store all scripts locally so requests are not a problem). I'm adding the BOM to all of them at the end using the snippet from update 2 of my main post.

My app now successfully certifies and runs flawlessly. Phew...

Post a Comment for "Grunt And Uglifyjs In Windows App Development - Utf8 Problems"