Skip to content

Add Encoder.Convert(ReadOnlySpan<char>, Span<byte>) polyfill#564

Merged
SimonCropp merged 1 commit into
mainfrom
Add-Encoder.Convert(ReadOnlySpan-char-,-Span-byte-)-polyfill
Jun 27, 2026
Merged

Add Encoder.Convert(ReadOnlySpan<char>, Span<byte>) polyfill#564
SimonCropp merged 1 commit into
mainfrom
Add-Encoder.Convert(ReadOnlySpan-char-,-Span-byte-)-polyfill

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Polyfills the span-based Encoder.Convert overload (introduced in netcoreapp2.1/netstandard2.1) for older targets, with unsafe pointer and safe array-based variants. The safe fallback matches BCL semantics exactly rather than using StringStream's input cap, since a general consumer expects exact charsUsed parity.

Qualify the unqualified Convert.* calls in Base64Polyfill and EnumPolyfill to System.Convert.* to avoid collision with the new Polyfill.Convert extension method.

Polyfills the span-based Encoder.Convert overload (introduced in
netcoreapp2.1/netstandard2.1) for older targets, with unsafe pointer
and safe array-based variants. The safe fallback matches BCL semantics
exactly rather than using StringStream's input cap, since a general
consumer expects exact charsUsed parity.

Qualify the unqualified Convert.* calls in Base64Polyfill and
EnumPolyfill to System.Convert.* to avoid collision with the new
Polyfill.Convert extension method.
@SimonCropp SimonCropp added this to the 10.11.1 milestone Jun 27, 2026
@SimonCropp SimonCropp merged commit a7916e4 into main Jun 27, 2026
3 of 5 checks passed
@SimonCropp SimonCropp deleted the Add-Encoder.Convert(ReadOnlySpan-char-,-Span-byte-)-polyfill branch June 27, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant