Skip to content

Fix subject encoding to use UTF-8 per NATS protocol spec#1054

Merged
mtmk merged 1 commit into
mainfrom
fix-subject-utf8
Jan 29, 2026
Merged

Fix subject encoding to use UTF-8 per NATS protocol spec#1054
mtmk merged 1 commit into
mainfrom
fix-subject-utf8

Conversation

@mtmk

@mtmk mtmk commented Jan 29, 2026

Copy link
Copy Markdown
Member
  • Change subject and reply-to parsing from Encoding.ASCII to configurable SubjectEncoding (default: Encoding.UTF8) per the NATS protocol convention
  • Update both read side (NatsReadProtocolProcessor) and write side (NatsOpts.SubjectEncoding default) so UTF-8 subjects round-trip correctly
  • Add XML docs for HeaderEncoding and SubjectEncoding options

Based on the work by @aafloy in #1025.

Resolves #1023.

@scottf scottf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mtmk
mtmk merged commit 5238a3d into main Jan 29, 2026
22 checks passed
@mtmk
mtmk deleted the fix-subject-utf8 branch January 29, 2026 14:55
mtmk added a commit that referenced this pull request Jan 30, 2026
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)
@mtmk mtmk mentioned this pull request Jan 30, 2026
mtmk added a commit that referenced this pull request Jan 30, 2026
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)
@aafloy

aafloy commented Jan 30, 2026

Copy link
Copy Markdown

Thanks for pulling my quick fix in the right direction @mtmk. I don't have the full view of NATS in my head, so.. Thanks! :)

@mtmk

mtmk commented Feb 2, 2026

Copy link
Copy Markdown
Member Author

Thanks for pulling my quick fix in the right direction @mtmk. I don't have the full view of NATS in my head, so.. Thanks! :)

no problem at all @aafloy thanks for the original PR 🚀 please feel free to drop more whenever you spot something. always welcome. Appreciate it! 😊

mtmk added a commit that referenced this pull request Feb 10, 2026
Changes in this release:
* Fix StreamSourceInfo.Active handle -1 correctly (#1058)
* Fix NatsUri not reflecting host/port changes from OnConnectingAsync hook (#997)

Chanfes from preview.2
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)

Changes from preview.1
* Fix and improve build for docs ci error (#1040)
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
* Fix slow consumer blocking (#1041)
@mtmk mtmk mentioned this pull request Feb 10, 2026
mtmk added a commit that referenced this pull request Feb 10, 2026
Changes in this release:
* Fix StreamSourceInfo.Active handle -1 correctly (#1058)
* Fix NatsUri not reflecting host/port changes from OnConnectingAsync hook (#997)

Chanfes from preview.2
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)

Changes from preview.1
* Fix and improve build for docs ci error (#1040)
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
* Fix slow consumer blocking (#1041)
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.

Subject is always read as ASCII, not UTF-8

3 participants