-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template strings do not respect ascii_only option #5910
Labels
Comments
alexlamsl
added a commit
to alexlamsl/UglifyJS
that referenced
this issue
Aug 7, 2024
Interesting use case − I didn't think people using latest versions of ECMAScript would still be struggling with Unicode 😉 |
Unicode isn't a problem, but null bytes in source code aren't the favorite of certain software 😁 |
Patch released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working with some modern JS code in an environment that doesn't handle control characters well, but the source code contains them in template strings. UglifyJS is outputting them raw even with
ascii_only
enabled.Uglify version (
uglifyjs -V
)JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.JavaScript output or error produced.
(with non-printable bytes written out:)
Potential solution
I think this would be solved by just adding
to_utf8
calls to the output forAST_Template
. It did resolve this in my local test, but I'm not familiar with the codebase.UglifyJS/lib/output.js
Lines 1786 to 1798 in 2255074
The text was updated successfully, but these errors were encountered: