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
Bad encoding experience #456
Comments
@legendtang Thanks for reporting this! This is definitely a concern. As my environments are all English, I haven't experienced this issue and probably won't be able to write up a fix. Internally, we rely on Node's Would you be able to work on a PR? Also, if you can think of any way I can test this out, please let me know. |
interim solutions
root causes
Code Pages
Local Codepage support on Windows |
I'm still unsure if this is our bug or Node's, and I don't know how to further investigate. I'm going to close this, but please ping this thread if this is still an issue and anyone has ideas for how to move this bug forward. |
Node version:
6.1.0
ShellJS version (the most recent version/Github branch you see the bug on):
0.7.0
Operating system:
Windows 10
Description of the bug:
Due to Node.js default behavior about encoding, all standard output will be transformed hard to
utf-8
. However, the default encoding of CMD is based on default lang of Windows, which means once you send command to non-utf8 terminal you will get non-utf8 output with utf-8 buffer string. That would probably irreversible, at least in my case in Chinese GB2312 (or Windows-936) encoding. Using iconv cannot revert the output again.Example ShellJS command to reproduce the error:
The output will be something like this:
If you manually convert to GBK, that will be:
The text was updated successfully, but these errors were encountered: