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

How to set Integrated Terminal default encoding to UTF-8? #19837

Closed
frocelu opened this issue Feb 3, 2017 · 16 comments
Closed

How to set Integrated Terminal default encoding to UTF-8? #19837

frocelu opened this issue Feb 3, 2017 · 16 comments
Assignees
Labels
info-needed Issue requires more information from poster terminal Integrated terminal issues

Comments

@frocelu
Copy link

frocelu commented Feb 3, 2017

  • VSCode Version: 1.9.0
  • OS Version: Windows 10 x64

Steps to Reproduce:
As title,I want to set the default encoding of Integrated Terminal to UTF-8.But I don't know how to do this.
Please teach me how to do this,thanks.

@yuriy-06
Copy link

yuriy-06 commented Feb 3, 2017

"tsc" �� ����� ����७��� ��� ���譥�
��������, �ᯮ��塞�� �ணࠬ��� ��� �������� 䠩���.

here is what the compiler is writting,
in the previous VSCODE version, output is worked fine.

VSCode Version: 1.9.0
OS Version: Windows 7 x64 / language = russian

@frocelu
Copy link
Author

frocelu commented Feb 3, 2017

You can use "chcp" command to set the encoding of Terminal.
Ex: "chcp 65001" is set to UTF-8.
But, you need do this when vs code open everytime.

@Tyriar Tyriar added help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues info-needed Issue requires more information from poster labels Feb 3, 2017
@Tyriar Tyriar self-assigned this Feb 3, 2017
@frocelu
Copy link
Author

frocelu commented Feb 4, 2017

If Integrated Terminal can execute some script automatically,it will help.

@Tyriar
Copy link
Member

Tyriar commented Feb 6, 2017

I don't know much about setting shell encoding on Windows so any help would be appreciated. If this can be set via an environment variable then that is doable. By default VS Code sets the $LANG environment variable on macOS to fix this there.

@yuriy-06
Copy link

yuriy-06 commented Feb 7, 2017

"chch 65001" not helped in output window, I,m just set locale to "en", as explained here - https://code.visualstudio.com/docs/customization/locales.
It helped on the same computer, but it does not work on another (wrong ouput).
It may be working some in preferences
"terminal.integrated.shell.windows": "C:\Windows\system32\cmd.exe \K chcp 65001",
or
"terminal.integrated.shellArgs.windows": ["chcp 65001"],

@frocelu
Copy link
Author

frocelu commented Feb 7, 2017

Thank yuriy-06,but it not works.
Error happens.

@yuriy-06
Copy link

yuriy-06 commented Feb 7, 2017

I'm run in cmd.exe "REG ADD HKCU\Console /v CodePage /t REG_DWORD /d 65001 /f"
when i'm run vscode, in output window:
"Parameter format not correct - 65001"
but when i'm typed
"D:...\projekt\fund_ts-master>chcp" =>
"Active code page: 65001."
Maybe it's the solution?

@yuryleb
Copy link

yuryleb commented Mar 31, 2017

"terminal.integrated.shellArgs.windows": ["/K", "chcp 65001"], works better 😉

@Tyriar
Copy link
Member

Tyriar commented Apr 1, 2017

@daviwil should this arg be rolled into the vscode-powershell extension? Is there any reason this isn't the default?

@Tyriar Tyriar removed the help wanted Issues identified as good community contribution opportunities label Apr 1, 2017
@gpassero
Copy link

gpassero commented Apr 2, 2017

@yuryleb I set PYTHONIOENCODING to UTF-8 and your solution didn't work for me. This one seems to have worked:

"terminal.integrated.shellArgs.windows": ["-NoExit", "/c", "chcp.com 65001"],

@Tyriar
Copy link
Member

Tyriar commented Apr 21, 2017

Ping @daviwil

@daviwil
Copy link
Contributor

daviwil commented Apr 21, 2017

Apologies, I've been buried in e-mail for the past week! This seems like a general issue with the terminal right? Seems that some here are having to configure cmd.exe with the same chcp call. I'll make sure the PS extension's Integrated Console also sets the mode correctly.

@Tyriar
Copy link
Member

Tyriar commented Apr 24, 2017

@daviwil setting it as the default could cause issues as then users have to change the shellArgs when they change the shell. Otherwise the terminal will exit immediately with an ambiguous error message due to unrecognized args.

@Tyriar Tyriar closed this as completed Apr 24, 2017
@artem-leonov
Copy link

artem-leonov commented Aug 10, 2017

@Tyriar But when use tasks with this workaround error happens. "Parameter format not correct - /d" for cmd and "Parameter format not correct - -Command" for powershell. I think you need to reopen this issue.

@Tyriar
Copy link
Member

Tyriar commented Aug 21, 2017

@artem-leonov if this is specific to tasks please create a new issue

@abdelhousni
Copy link

In Windows,
I set "LC_ALL=fr_BE.UTF-8" as an environement variable (restart Visual Studio Code to apply)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

8 participants