diff --git a/Directory.Build.props b/Directory.Build.props index 96dfe335c..3c8502449 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -103,7 +103,7 @@ $(RootDir)bin\$(Configuration) $(BaseOutputPath) true - 618;429;219;1717;162;414 + 618;429;219;1717;162;414;NU1900;CA1859;CA1861 1591;1584;1574;1685;1573 prompt 4 diff --git a/Src/IronPython/IronPython.csproj b/Src/IronPython/IronPython.csproj index f9749b961..8ed0a8e56 100644 --- a/Src/IronPython/IronPython.csproj +++ b/Src/IronPython/IronPython.csproj @@ -61,7 +61,7 @@ - + diff --git a/Src/IronPython/Runtime/PythonContext.cs b/Src/IronPython/Runtime/PythonContext.cs index b604236ed..25a496c7e 100644 --- a/Src/IronPython/Runtime/PythonContext.cs +++ b/Src/IronPython/Runtime/PythonContext.cs @@ -44,6 +44,15 @@ namespace IronPython.Runtime public delegate int HashDelegate(object o, ref HashDelegate dlg); public sealed partial class PythonContext : LanguageContext { + static PythonContext() { + try { +#if NETCOREAPP || NETSTANDARD + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); +#endif + } catch { + } + } + internal static readonly string/*!*/ IronPythonDisplayName = CurrentVersion.DisplayName; internal const string/*!*/ IronPythonNames = "IronPython;Python;py"; internal const string/*!*/ IronPythonFileExtensions = ".py";