Skip to content

Commit

Permalink
Set UTF-8 encoding for working with GB18030 (#4447)
Browse files Browse the repository at this point in the history
Update new TF.exe version in externals
  • Loading branch information
ivanduplenskikh authored Sep 20, 2023
1 parent 2611572 commit a7dfe98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Agent.Plugins/TFCliManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public override TfsVCFeatures Features
}
}

// When output is redirected, TF.exe writes output using the current system code page
// (i.e. CP_ACP or code page 0). E.g. code page 1252 on an en-US box.
protected override Encoding OutputEncoding => StringUtil.GetSystemEncoding();
// We ship a special version of TF.exe which uses UTF-8 instead of default encoding to support all the Unicode characters
// to comply with GB18030. Mainstream TF.exe uses default system encoding for redirected output.
protected override Encoding OutputEncoding => Encoding.UTF8;

protected override string Switch => "/";

Expand Down
2 changes: 1 addition & 1 deletion src/Agent.Plugins/TfsVCCliManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class TfsVCCliManager
public abstract Task<bool> TryWorkspaceDeleteAsync(ITfsVCWorkspace workspace);
public abstract Task WorkspacesRemoveAsync(ITfsVCWorkspace workspace);

protected virtual Encoding OutputEncoding => null;
protected virtual Encoding OutputEncoding => Encoding.UTF8;

protected string SourceVersion
{
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ if [[ "$PACKAGERUNTIME" == "win-x"* ]]; then
acquireExternalTool "$CONTAINER_URL/git-lfs/${LFS_VERSION}/x${BIT}/git-lfs.exe" "git/mingw${BIT}/bin"
acquireExternalTool "$CONTAINER_URL/pdbstr/1/pdbstr.zip" pdbstr
acquireExternalTool "$CONTAINER_URL/symstore/1/symstore.zip" symstore
acquireExternalTool "$CONTAINER_URL/vstsom/m153_d91bed0b/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vstsom/m153_47c0856d/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vswhere/2_8_4/vswhere.zip" vswhere

acquireExternalTool "https://dist.nuget.org/win-x86-commandline/v3.4.4/nuget.exe" nuget
Expand Down

0 comments on commit a7dfe98

Please sign in to comment.