Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/core/IronPython.Modules/IronPython.Modules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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});
</MeziantouPolyfill_IncludedPolyfills>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions src/core/IronPython/IronPython.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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});
</MeziantouPolyfill_IncludedPolyfills>
</PropertyGroup>

Expand Down
9 changes: 0 additions & 9 deletions src/core/IronPython/Runtime/PythonEncoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<byte> 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<char> chars, bool flush) {
fixed (char* pChars = &MemoryMarshal.GetReference(chars)) {
Expand Down
Loading