yuanyan/UglifyJS-java — Issue #1: it seems UglifyJS-java can't read non-ASCII characters in UTF8 files
Author: lucars
Created: 2011-11-22 06:01:53+00:00
State: open

"~/Sites/uglifyjs/test.js" is an UTF8 file and have non-ASCII characters. When I try to use UglifyJS-java like this:
java -jar uglifyjs-java.jar -nm -nc -o tmp/test.js ~/Sites/uglifyjs/test.js

It output error as:
Unexpected token name, expected punc | 5008 | 39 | 189814
javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: [object Object] (#274) in at line number 274
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:153)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:167)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
at uglify.UglifyJS.exec(UglifyJS.java:53)
at uglify.UglifyJS.main(UglifyJS.java:16)

After I convert "~/Sites/uglifyjs/test.js" to GB18030, UglifyJS-java works well.