Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
<Compile Include="..\Shared\EncodingStringWriter.cs">
<Link>EncodingStringWriter.cs</Link>
</Compile>
<Compile Include="..\Shared\EncodingUtilities.cs">
<Link>EncodingUtilities.cs</Link>
</Compile>
<Compile Include="..\Shared\UnitTests\ObjectModelHelpers.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down
3 changes: 0 additions & 3 deletions src/Build/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\Shared\EncodingUtilities.cs">
<Link>SharedUtilities\EncodingUtilities.cs</Link>
</Compile>
<Compile Include="..\Shared\EnvironmentUtilities.cs">
<Link>SharedUtilities\EnvironmentUtilities.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using System.Linq;
using System.Text;

using Microsoft.Build.Framework;

#nullable disable

namespace Microsoft.Build.Shared
Expand Down Expand Up @@ -48,17 +50,17 @@ internal static Encoding CurrentSystemOemEncoding

try
{
if (NativeMethodsShared.IsWindows)
if (NativeMethods.IsWindows)
{
#if RUNTIME_TYPE_NETCORE
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
#endif
// get the current OEM code page
s_currentOemEncoding = Encoding.GetEncoding(NativeMethodsShared.GetOEMCP());
s_currentOemEncoding = Encoding.GetEncoding(NativeMethods.GetOEMCP());
}
}
// theoretically, GetEncoding may throw an ArgumentException or a NotSupportedException. This should never
// really happen, since the code page we pass in has just been returned from the "underlying platform",
// really happen, since the code page we pass in has just been returned from the "underlying platform",
// so it really should support it. If it ever happens, we'll just fall back to the default encoding.
// No point in showing any errors to the users, since they most likely wouldn't be actionable.
catch (ArgumentException ex)
Expand Down Expand Up @@ -214,7 +216,7 @@ internal static bool CanEncodeString(int codePage, string stringToEncode)
/// </remarks>
internal static Encoding BatchFileEncoding(string contents, string encodingSpecification)
{
if (!NativeMethodsShared.IsWindows)
if (!NativeMethods.IsWindows)
{
return EncodingUtilities.Utf8WithoutBom;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Tasks/Microsoft.Build.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@
<Compile Include="..\Shared\AssemblyNameExtension.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="..\Shared\EncodingUtilities.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="..\Shared\ErrorUtilities.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down
3 changes: 0 additions & 3 deletions src/Utilities/Microsoft.Build.Utilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@
<Compile Include="..\Shared\CopyOnWriteDictionary.cs">
<Link>Shared\CopyOnWriteDictionary.cs</Link>
</Compile>
<Compile Include="..\Shared\EncodingUtilities.cs">
<Link>Shared\EncodingUtilities.cs</Link>
</Compile>
<Compile Include="..\Shared\ErrorUtilities.cs">
<Link>Shared\ErrorUtilities.cs</Link>
</Compile>
Expand Down