Vscode: Tasks should support specifying the output encoding

Created on 29 Feb 2016  ·  17Comments  ·  Source: microsoft/vscode

I think it's related to some global language problem.

The output message is broken like this

'luac'��(��) ���� �Ǵ� �ܺ� ����, ������ �� �ִ� ���α׷�, �Ǵ�
��ġ ������ �ƴմϴ�.

P.S> My environment is Win10 Ko(Korean version)

https://onedrive.live.com/redir?resid=73F0A5AA67A0D48F!212183&authkey=!ACjcDNvjj7PjRmY&v=3&ithint=photo%2cpng

tasks

Most helpful comment

Why is it a "feature-request"? Not garbling an output is not a feature. I think it should be "bug" and "important".

All 17 comments

For sure we're blindly converting to/from utf8 somewhere...

+1 . hope to fix as soon as possible

+2. It's really a boring bug, hope to get it down in the next release version. 🎱
Now I use the internal console instead of tasks. :-(

Please see https://github.com/Microsoft/vscode/issues/15179. The idea here to move forward is to execute tasks in the terminal instead in its own output channel.

Have the same problem Win10/Russian MsBuild. Really annoying.

Agree. The plan forward here is to use the integrated terminal to run tasks. This will make this work and even support input and ANSI control characters

Why is it a "feature-request"? Not garbling an output is not a feature. I think it should be "bug" and "important".

In __tasks.json__:
use

"command": "cmd",
"args": ["/c chcp 65001 >nul && mingw32-make"]

instead of

"command": "mingw32-make"

and everything seems to work fine.

compiling...
main.cpp
e:\projects\c++\vscode_test\main.cpp(247): error C2143: 语法错误: 缺少“;”(在“return”的前面)
mingw32-make: * [main.obj] Error 2
Makefile:37: recipe for target 'main.obj' failed

@EternalPhane thanks for this. Actually I am working on support for running tasks in the integrated terminal which should make the encoding problem go away.

@dbaeumer update on this feature would be much appreciated. Not being able to figure out what the error message is makes the task feature almost unusable, thanks.

@gyuhyeon this will be addressed by using the terminal as the execution engine for tasks. You can alreadz opt into using the terminal by adding "runner": "terminal" to your tasks.json

"runner":"terminal" does not appear to work anymore, I have had success setting the ENV before my command. I am on a Mac.

I was trying to run Jekyll.

"command": "export LANG=en_US.UTF-8 && export LC_ALL=en_US.UTF-8 && jekyll serve --watch"

@rajannpatel strange, "runner": "terminal" is still supported. You can also switch to tasks version 2.0.0. Can you provide a tasks.json file which demonstrates the behavior.

Thanks!
export LC_ALL=en_US.UTF-8 (for Russian export LC_ALL=ru_RU.UTF-8) helped me on Debian Linux added in file .bashrc

[Addressed in new terminal runner]

In the new terminal runner with can be controlled by configuring the shell to be used in the tasks.json. This allows to control the encoding.

I am closing this issue since this can now be control using normal Terminal setups in task 2.0.0. I also wrote some doc explaining how this is best used here: https://github.com/Microsoft/vscode-docs/blob/vnext/docs/editor/tasks.md#changing-the-encoding-for-a-task-output

I will close the issue. Please reopen a new issue against the current support if it is not satisfactory for you.

Was this page helpful?
0 / 5 - 0 ratings