42 references to EncodingUtilities
Microsoft.Build (1)
Logging\FileLogger.cs (1)
44if (EncodingUtilities.GetExternalOverriddenUILanguageIfSupportableWithEncoding() != null)
Microsoft.Build.CommandLine.UnitTests (1)
XMake_Tests.cs (1)
906if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !EncodingUtilities.CurrentPlatformIsWindowsAndOfficiallySupportsUTF8Encoding())
Microsoft.Build.Engine.OM.UnitTests (2)
Construction\ProjectFormatting_Tests.cs (2)
691Assert.Equal(byteOrderMark, EncodingUtilities.FileStartsWithPreamble(file)); 709Assert.Equal(byteOrderMark, EncodingUtilities.FileStartsWithPreamble(file));
Microsoft.Build.Framework (11)
EncodingUtilities.cs (11)
226return EncodingUtilities.Utf8WithoutBom; 229var defaultEncoding = EncodingUtilities.CurrentSystemOemEncoding; 237defaultEncoding = EncodingUtilities.Utf8WithoutBom; 240string useUtf8 = string.IsNullOrEmpty(encodingSpecification) ? EncodingUtilities.UseUtf8Detect : encodingSpecification; 244case EncodingUtilities.UseUtf8Always: 245case EncodingUtilities.UseUtf8True: 246return EncodingUtilities.Utf8WithoutBom; 247case EncodingUtilities.UseUtf8Never: 248case EncodingUtilities.UseUtf8System: 251return EncodingUtilities.CanEncodeString(defaultEncoding.CodePage, contents) 253: EncodingUtilities.Utf8WithoutBom;
Microsoft.Build.Tasks.Core (4)
Exec.cs (4)
38_standardOutputEncoding = EncodingUtilities.CurrentSystemOemEncoding; 39_standardErrorEncoding = EncodingUtilities.CurrentSystemOemEncoding; 196var encoding = EncodingUtilities.BatchFileEncoding(Command + WorkingDirectory, UseUtf8Encoding); 228if (encoding.CodePage != EncodingUtilities.CurrentSystemOemEncoding.CodePage)
Microsoft.Build.Tasks.UnitTests (3)
Exec_Tests.cs (3)
482RunExec(false, EncodingUtilities.CurrentSystemOemEncoding.EncodingName); 512RunExec(true, EncodingUtilities.CurrentSystemOemEncoding.EncodingName, useUtf8, false); 523RunExec(false, EncodingUtilities.CurrentSystemOemEncoding.EncodingName, useUtf8);
Microsoft.Build.Utilities.Core (8)
ToolTask.cs (8)
198public string UseUtf8Encoding { get; set; } = EncodingUtilities.UseUtf8Detect; 249return EncodingUtilities.CurrentSystemOemEncoding; 273return EncodingUtilities.CurrentSystemOemEncoding; 1424File.AppendAllText(_temporaryBatchFile, AdjustCommandsForOperatingSystem(commandLineCommands), EncodingUtilities.CurrentSystemOemEncoding); 1434encoding = EncodingUtilities.CurrentSystemOemEncoding; 1438encoding = EncodingUtilities.BatchFileEncoding(commandLineCommands + _temporaryBatchFile, UseUtf8Encoding); 1440if (encoding.CodePage != EncodingUtilities.CurrentSystemOemEncoding.CodePage) 1448EncodingUtilities.CurrentSystemOemEncoding);
Microsoft.Build.Utilities.UnitTests (10)
EncodingUtilities_Tests.cs (9)
26var defaultEncoding = EncodingUtilities.CurrentSystemOemEncoding; 31EncodingUtilities.CanEncodeString(defaultEncoding.CodePage, nonAnsiCharacters).ShouldBeFalse(); 32EncodingUtilities.CanEncodeString(defaultEncoding.CodePage, pathWithAnsiCharacters).ShouldBeTrue(); 44if (!EncodingUtilities.CurrentPlatformIsWindowsAndOfficiallySupportsUTF8Encoding()) 54EncodingUtilities.GetExternalOverriddenUILanguageIfSupportableWithEncoding().ShouldBeEquivalentTo(new CultureInfo(expectedLanguage)); 62var alwaysEncoding = EncodingUtilities.BatchFileEncoding(content, EncodingUtilities.UseUtf8Always); 63EncodingUtilities.BatchFileEncoding(content, EncodingUtilities.UseUtf8True).ShouldBe(alwaysEncoding);
ToolTask_Tests.cs (1)
263t.UseUtf8Encoding = EncodingUtilities.UseUtf8Always;
MSBuild (2)
XMake.cs (2)
1900var desiredCulture = EncodingUtilities.GetExternalOverriddenUILanguageIfSupportableWithEncoding() ?? CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); 1911if (EncodingUtilities.CurrentPlatformIsWindowsAndOfficiallySupportsUTF8Encoding()