-
Notifications
You must be signed in to change notification settings - Fork 25
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
Output Windows Encoding Problem #67
Comments
Unable to reproduce ( I copied the code from here, so it could be saved in unicode )
As far as I can tell AutoIt-VSCode doesn't use SciTE configurations. |
The default codepage is depending on the language of Windows settings, for Chinese it's cp936. So I have to put these in my SciTEUser.properties, to get correct output in the Output Panel of Scite.
VSCode doesn't have similar things like this, and that cause my problems. Please take a look with this script:
In Scite, with VSCode assumes encoding of output is UTF-8, which is not. |
cp936 is GBK, a superset of GB2312. GB18030 is a superset of GBK, but it's a 4-bytes encoding, so it has a new identifier cp54936. I didn't know anything about VSCode Extension API, if there's no such thing like GetACP(), Before write to the Output Panel of VSCode, convert the output of AutoIt from |
The encoding of script file is not relevant to this problem. Can you show me the output of my script in VSCode, please? |
I guess we are out of luck on this one. Almost 7 years since it was requested... |
WOW, a text editor (sort of) cannot handle text encoding, I didn't expect for that. Seems there's nothing we can do now. Thanks for your time. |
Well, technically, if you can see text of your code properly - it handles encoding properly...it's the output of another application that it's having issues with... |
Even now (Win11 22H2), Powershell and CMD use ANSI (aka cp936 for Chinese) as the default code page. If I compile my script as a CUI EXE, here is the output: Same as the output in Scite. ConsoleWrite intend to write something to STDOUT, and the default codepage of STDOUT is ANSI. As a user, I would love to have a solution, but I can't say that Autoit is wrong. Also, I think it's not fair to you. You did a greate job, but CJK users have to choose. |
Maybe as a work around you could use this for now: |
Proposed #123 adds new option |
WOW, thank you for keep working on this.
I tink you can ignore the difference in AutoIt-VSCode. However, they do have some differences between GBK and CP936. You could consider GBK as ECMAScript7, and CP936 as Crhome V8. If a code-point is undefined in the standard, the author of charmap could make the decision how to handle the conversion. Take a look at this:
Output:
Even though I'm not sure, but I guess that's why the GBK charmap of iconv-lite is not compatible with CP936. |
It's all Chinese to me (pun intended) Maybe it would be more suitable to report it at iconv-lite |
It's not a bug of iconv-lite, Chinese people would recognize the differences between GBK and CP936, they have to. The text encodings are real pain in the ass, really. The problems could jump out everywhere. But for English native speakers, they didn't use it, and hard to explain to them. Like you said, it's all Chinese. So I'm very grateful for you, I do. |
So, the question is, does SciTe has the same issue? (cause on your screenshot it looks exactly like in vcode after conversion) |
Generally, when we saw messy codes, it just means "Something is wrong here". As long as iconv-lite handle the normal text correctly, I think we can ignore the details. |
SciTEUser.properties:
t.au3:
I think it's an encoding problem. Before update the Output panel of VSCode, AutoIt-VSCode should deal with the Encoding of strings.
Thanks.
The text was updated successfully, but these errors were encountered: