lautis / uglifier

Ruby wrapper for UglifyJS JavaScript compressor.
http://www.rubydoc.info/gems/uglifier
MIT License
613 stars 82 forks source link

IE8 + utf-8 problem, part 2 #67

Closed plentz closed 10 years ago

plentz commented 10 years ago

I've found another situation where quoting is needed. if you have a key, like this

{ÿ:"3"}

IE8+(9, 10 and 11, also) will fail, so I think that the right behavior is to make :quote_keys => true the default.

related #58

lautis commented 10 years ago

I'm not able to replicate this with the example input. What JS runtime are you using?

plentz commented 10 years ago

this is the file generated by uglifier: https://gist.github.com/plentz/5d07c59019678ef663c7

and this is the message showed in IE8 screen shot 2014-02-09 at 1 16 22 pm

I think it can be related to this piece

...ò:{d:"83,-199v56...
lautis commented 10 years ago

This seems to be caused by serving the file without charset header, in which case IE assumes that the file is encoded in Latin-1. In addition to using ascii_only: true, the issue can be fixed by using Content-Type: application/javascript; charset=UTF-8 or with `charset="UTF-8" attribute in the script tag.