Replace Encoding.Default with Encoding.UTF8 for clarity#2516
Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom Apr 16, 2026
Merged
Replace Encoding.Default with Encoding.UTF8 for clarity#2516jeremydmiller merged 1 commit intoJasperFx:mainfrom
jeremydmiller merged 1 commit intoJasperFx:mainfrom
Conversation
On .NET Core / .NET 5+ Encoding.Default always returns UTF8Encoding, so this is a no-op at runtime but removes the misleading "locale- dependent ANSI" connotation carried over from .NET Framework. The UTF-8 contract is what AMQP 0-9-1, JSON (RFC 8259), and Kafka all mandate, and Wolverine already used Encoding.UTF8 in equivalent spots. Applies across HTTP, Kafka, MQTT, RabbitMQ, Azure Service Bus, and AWS SQS production code plus the corresponding tests and docs. Closes JasperFx#2513
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2513
Encoding.DefaultreturnsUTF8Encodingon .NET Core / .NET 5+, so this isa no-op at runtime. The rename removes the misleading "locale-dependent ANSI"
connotation carried over from .NET Framework and aligns the source with the
UTF-8 contract that AMQP 0-9-1, JSON (RFC 8259) and Kafka all mandate.
Scope
Verification
CoreTestson net10.0: 1319 passed, 0 failed.UTF8Encodingsingleton on every TFM Wolverine targets.