non-ASCII identifiers cause invalid JavaScript to be output when ascii_only is true #173

papandreou opened this Issue Mar 31, 2013 · 3 comments


None yet
3 participants

papandreou commented Mar 31, 2013

$ ./bin/uglifyjs --beautify ascii_only=true
ø = 123;
\xf8 = 123;

The problem is that identifier names are also run through the to_ascii function, which is meant to ASCII-fy the contents of strings and regexps:

    function make_name(name) {
        name = name.toString();
        if (options.ascii_only)
            name = to_ascii(name);
        return name;

I'm not sure what the correct fix would be.

@mishoo mishoo closed this in a869b85 Mar 31, 2013


michaelficarra commented Mar 31, 2013

@mishoo: that's not the correct fix. Just use the \uXXXX escapes instead of the \xXX escapes for identifiers.


mishoo commented Mar 31, 2013

@michaelficarra isn't that what it's doing?


michaelficarra commented Mar 31, 2013

Whoops, sorry. You were right. I misread the diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment