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

Windows: try to be smarter about encoding detection #39664

Closed
bpasero opened this issue Dec 5, 2017 · 10 comments
Closed

Windows: try to be smarter about encoding detection #39664

bpasero opened this issue Dec 5, 2017 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Dec 5, 2017

Instead of hardcoding the encoding to cp850, should actually check the output of running chcp and find some well supported encodings we could use instead.

Refs: https://ss64.com/nt/chcp.html

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Dec 5, 2017
@bpasero bpasero added this to the November 2017 milestone Dec 5, 2017
@bpasero bpasero self-assigned this Dec 5, 2017
@bpasero bpasero closed this as completed in b454c2a Dec 5, 2017
@roblourens
Copy link
Member

Verification steps? Is this for the integrated terminal?

@bpasero
Copy link
Member Author

bpasero commented Dec 8, 2017

@roblourens this is for #39330

@roblourens
Copy link
Member

roblourens commented Dec 8, 2017

I don't think I'm doing it right, here's what I've tried

  • chcp 866 for Russian
  • echo 'глаголь добро есть' | code-insiders
  • Change encoding in vscode to CP 866
  • Result is random characters

...

  • Have a file encoded as CP 866 with russian text
  • type russian.txt | code-insiders
  • Change encoding in vscode to CP 866
  • Result is random characters

Same with Greek, 1253

@bpasero
Copy link
Member Author

bpasero commented Dec 9, 2017

@roblourens we are not carrying over the encoding into VS Code, so the file in VS Code will be whatever your default encoding is (most likely UTF-8). If you see the characters you type showing up properly in VS Code, you have verified this bug.

@roblourens
Copy link
Member

I fix the encoding in vscode manually, but even then, the characters are not correct.

@bpasero
Copy link
Member Author

bpasero commented Dec 10, 2017

@roblourens I see. I think the issue here is that you are only changing the encoding for the current running terminal session and when VS Code starts, I run chcp again but in a different terminal. I think this only works if the terminal encoding is set more permanently and not per the current session.

@roblourens
Copy link
Member

You're right, it works great after changing my system locale to Russian.

@roblourens roblourens added the verified Verification succeeded label Dec 11, 2017
@bpasero
Copy link
Member Author

bpasero commented Dec 12, 2017

@roblourens thanks for testing this!

@heroboy
Copy link

heroboy commented Dec 15, 2017

@bpasero please add 936:"cp936" for Simplified Chinese.
I modified cli.js, and tested dir|node, it works.

@bpasero
Copy link
Member Author

bpasero commented Dec 15, 2017

@heroboy ok I can add it.

bpasero added a commit that referenced this issue Dec 15, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants