Skip to content

Replace Encoding.Default with Encoding.UTF8 for clarity#2516

Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom
BlackChepo:refactor/2513_Encoding
Apr 16, 2026
Merged

Replace Encoding.Default with Encoding.UTF8 for clarity#2516
jeremydmiller merged 1 commit intoJasperFx:mainfrom
BlackChepo:refactor/2513_Encoding

Conversation

@BlackChepo
Copy link
Copy Markdown
Contributor

Closes #2513

Encoding.Default returns UTF8Encoding on .NET Core / .NET 5+, so this is
a 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

  • Production: HTTP, Kafka, MQTT, RabbitMQ, Azure Service Bus (11 files)
  • Tests: CoreTests, SlowTests, MQTT, RabbitMQ, AWS SQS (5 files)
  • Docs: messages, message-bus, sqs/interoperability, interop (4 files)

Verification

  • All touched projects build with 0 warnings / 0 errors.
  • CoreTests on net10.0: 1319 passed, 0 failed.
  • No behavioural change — both properties resolve to the same UTF8Encoding
    singleton on every TFM Wolverine targets.

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
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.

Cleanup: Replace Encoding.Default with Encoding.UTF8 for clarity and consistency

2 participants