JsonSerializer escaping '&'

I looked at https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/character-encoding and I still got nothing, I don't understand why these few symbols don't work in json format?
How to customize character encoding with System.Text.Json - .NET
Learn how to customize character encoding while serializing to and deserializing from JSON in .NET.
7 Replies
🌸 morgan period 🌸
Do I have to do something like [JsonInclude]?
[JsonInclude]
public string a = "test &";
[JsonInclude]
public string a = "test &";
Angius
Angius•3mo ago
Does it matter if it gets deserialized correctly anyway?
Angius
Angius•3mo ago
No description
Angius
Angius•3mo ago
JS has no issues parsing the escaped ampersand either
No description
Angius
Angius•3mo ago
Pretty sure if I tried Python, Dart, Kotlin, Rust, or whatever else is supposed to be consuming that JSON, they would have no issues either
🌸 morgan period 🌸
Well I'm making it so the user can open the json and change the values. So when it gets rewritten it ruins the &
Want results from more Discord servers?
Add your server