Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions src/Scripty.MsBuild/ScriptyTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public override bool Execute()
return false;
}

// Some build environments by default use non-UTF8 character encodings. This
// fixes issues in those environments by forcing the character encoding to match
// the decoding in the target process.
Console.InputEncoding = Encoding.UTF8;
Console.OutputEncoding = Encoding.UTF8;

// Kick off the evaluation process, which must be done in a seperate process space
// otherwise MSBuild complains when we construct the Roslyn workspace project since
// it uses MSBuild to figure out what the project contains and MSBuild only supports
Expand Down
6 changes: 6 additions & 0 deletions src/Scripty/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ private KeyValuePair<string, string> ParseProperty(string argument)

public void ReadStdin()
{
// Some build environments by default use non-UTF8 character encodings. This
// fixes issues in those environments by forcing the character encoding to match
// the decoding in the target process.
Console.InputEncoding = Encoding.UTF8;
Console.OutputEncoding = Encoding.UTF8;

string stdin = Console.In.ReadToEnd();
JsonConvert.PopulateObject(stdin, this);
}
Expand Down