-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Changes from 6 commits
32abc59
711207d
92a564b
57a4195
9813ec9
b71083d
17432c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ export class dotNetExe { | |
|
||
public async execute() { | ||
tl.setResourcePath(path.join(__dirname, "task.json")); | ||
this.setConsoleCodePage(); | ||
|
||
switch (this.command) { | ||
case "build": | ||
|
@@ -58,6 +59,18 @@ export class dotNetExe { | |
} | ||
} | ||
|
||
private setConsoleCodePage() { | ||
// set the console code page to "UTF-8" | ||
if (tl.osType() === 'Windows_NT') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any exception thrown from this should be ignored with a warning |
||
try { | ||
tl.execSync(path.resolve(process.env.windir, "system32", "chcp.com"), ["65001"]); | ||
} | ||
catch (ex) { | ||
tl.warning(tl.loc("CouldNotSetCodePaging", JSON.stringify(ex))) | ||
} | ||
} | ||
} | ||
|
||
private async executeBasicCommand() { | ||
var dotnetPath = tl.which("dotnet", true); | ||
|
||
|
There was a problem hiding this comment.
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?