Use TranscodingStream for converting to UTF-8#342
Conversation
|
This feels like it's reasonable - it's entirely an implementation detail, so a simple |
Signed-off-by: Erwin <erwinkramer@hotmail.com>
54c9d75 to
9326f9e
Compare
|
@jskeet sure, I made it conditional now. Should be good to go. |
|
@jskeet letting you know this one's still waiting for you |
|
Thanks, thought I'd reviewed it yesterday - will have another look when I get a chance |
|
Ah, no - I reviewed a different one before. Will look at this next weekend. (Sorry to be slow on these.) |
jskeet
left a comment
There was a problem hiding this comment.
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...
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. |
|
Adding testing in a separate PR works for me. Merging. |
This leverages
CreateTranscodingStreamto 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.