Skip to content

Use TranscodingStream for converting to UTF-8#342

Merged
jskeet merged 1 commit intocloudevents:mainfrom
erwinkramer:feature/transcodingstream
May 5, 2026
Merged

Use TranscodingStream for converting to UTF-8#342
jskeet merged 1 commit intocloudevents:mainfrom
erwinkramer:feature/transcodingstream

Conversation

@erwinkramer
Copy link
Copy Markdown
Contributor

@erwinkramer erwinkramer commented Apr 10, 2026

This leverages CreateTranscodingStream to change the encoding to UTF-8 when required. Because this only exists on .NET 5 and up, I made it conditional and kept the old logic for lower .NET versions.

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Apr 11, 2026

This feels like it's reasonable - it's entirely an implementation detail, so a simple #if would be fine IMO.

Signed-off-by: Erwin <erwinkramer@hotmail.com>
@erwinkramer erwinkramer force-pushed the feature/transcodingstream branch from 54c9d75 to 9326f9e Compare April 12, 2026 08:24
@erwinkramer erwinkramer marked this pull request as ready for review April 12, 2026 08:26
@erwinkramer
Copy link
Copy Markdown
Contributor Author

@jskeet sure, I made it conditional now. Should be good to go.

@erwinkramer
Copy link
Copy Markdown
Contributor Author

@jskeet letting you know this one's still waiting for you

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Apr 27, 2026

Thanks, thought I'd reviewed it yesterday - will have another look when I get a chance

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Apr 27, 2026

Ah, no - I reviewed a different one before. Will look at this next weekend. (Sorry to be slow on these.)

Copy link
Copy Markdown
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

Change looks good. I'm slightly worried that we're not testing the old path, as our tests only run on .NET 8 and .NET 10.

If you have any thoughts on how we can address that in this PR, great - otherwise I'll merge in 48 hours. Potentially we should have tests that run on .NET Framework, with suitable "only on Windows" checks etc...

@erwinkramer
Copy link
Copy Markdown
Contributor Author

erwinkramer commented May 5, 2026

we should have tests that run on .NET Framework, with suitable "only on Windows" checks etc...

Yeah, in general we target 4.x so makes sense to also build and run the tests during the GitHub workflow for that target. I guess we can do this in a separate PR.

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented May 5, 2026

Adding testing in a separate PR works for me. Merging.

@jskeet jskeet merged commit d84ffae into cloudevents:main May 5, 2026
2 checks passed
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.

2 participants