Skip to content
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

Encoding problem #49

Open
viktorvi opened this issue Jan 13, 2017 · 2 comments
Open

Encoding problem #49

viktorvi opened this issue Jan 13, 2017 · 2 comments

Comments

@viktorvi
Copy link

Hi,

I hava a js file which contains the following line:

var char = '×××××××'

After I use optimize-js then I received the following result:

var char = '´┐Ż´┐Ż´┐Ż´┐Ż´┐Ż´┐Ż´┐Ż'

I am using the following powershell script:

$PSDefaultParameterValues = @{ '*:Encoding' = 'utf8' } 
 <#npm install -g optimize-js #>
optimize-js 'c:\!Publish\js\test.js' > 'c:\!Publish\js\test2.js'

Example.zip

@nolanlawson
Copy link
Owner

Hm weird, I can reproduce in BashOnWindows but not on macOS.

@nolanlawson
Copy link
Owner

As an alternative, you can use the JS API instead of the CLI, since that gives you full control over the string and therefore you control the encoding. Sorry for the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants