C#C
C#16mo ago
Ploot

✅ JsonSerializer ignoring encoding options?

This issue has been driving me crazy for the last hour. I have a json object that includes a string with an apostrophe in it, however it keeps getting converted to a unicode code.
After some reading I found this was the default behaviour for the serializer and can be overridden with encoder options, however I have been totally unable to override this behaviour for some reason.

This is the dotnetfiddle snippet I've been testing with https://dotnetfiddle.net/7VZABE. Am I doing something wrong here?
Was this page helpful?