diff --git a/src/core/IronPython.Modules/IronPython.Modules.csproj b/src/core/IronPython.Modules/IronPython.Modules.csproj index 86e575a48..f6185c153 100644 --- a/src/core/IronPython.Modules/IronPython.Modules.csproj +++ b/src/core/IronPython.Modules/IronPython.Modules.csproj @@ -15,6 +15,7 @@ T:System.Runtime.Versioning.SupportedOSPlatformAttribute; M:System.String.Contains(System.Char); M:System.String.EndsWith(System.Char); + M:System.Text.Encoding.GetString(System.ReadOnlySpan{System.Byte}); diff --git a/src/core/IronPython/IronPython.csproj b/src/core/IronPython/IronPython.csproj index 9360331b0..902f0c66d 100644 --- a/src/core/IronPython/IronPython.csproj +++ b/src/core/IronPython/IronPython.csproj @@ -19,6 +19,7 @@ M:System.String.Contains(System.Char); M:System.String.EndsWith(System.Char); M:System.String.StartsWith(System.Char); + M:System.Text.Encoding.GetString(System.ReadOnlySpan{System.Byte}); diff --git a/src/core/IronPython/Runtime/PythonEncoding.cs b/src/core/IronPython/Runtime/PythonEncoding.cs index da40a4bb9..042349f3b 100644 --- a/src/core/IronPython/Runtime/PythonEncoding.cs +++ b/src/core/IronPython/Runtime/PythonEncoding.cs @@ -1532,15 +1532,6 @@ public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int #if !NETCOREAPP // TODO: Move to IronPython.Runtime.Text - internal static class EncodingExtensions { - public static unsafe string GetString(this Encoding encoding, ReadOnlySpan bytes) { - fixed (byte* bytesPtr = &MemoryMarshal.GetReference(bytes)) { - return encoding.GetString(bytesPtr, bytes.Length); - } - - } - } - internal static class EncoderExtensions { public static unsafe int GetByteCount(this Encoder encoder, ReadOnlySpan chars, bool flush) { fixed (char* pChars = &MemoryMarshal.GetReference(chars)) {