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

Set the console code page to "UTF-8" #6274

Merged
merged 7 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Tasks/DotNetCoreCLI/dotnetcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class dotNetExe {

public async execute() {
tl.setResourcePath(path.join(__dirname, "task.json"));
this.setConsoleCodePage();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this actually be handled in task-lib?

if (this.command === "custom") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a merge issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is.

this.command = tl.getInput("custom", true);
}

switch (this.command) {
case "build":
Expand Down Expand Up @@ -58,6 +62,13 @@ export class dotNetExe {
}
}

private setConsoleCodePage() {
// set the console code page to "UTF-8"
if (tl.osType() === 'Windows_NT') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does it need to be done in other tasks where we are invoking exes like az cli, packer

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any exception thrown from this should be ignored with a warning

tl.execSync(path.resolve(process.env.windir, "system32", "chcp.com"), ["65001"]);
}
}

private async executeBasicCommand() {
var dotnetPath = tl.which("dotnet", true);

Expand Down
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLI/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 129,
"Patch": 4
"Minor": 130,
"Patch": 0
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "dotnet $(command)",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLI/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 129,
"Patch": 4
"Minor": 130,
"Patch": 0
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down