it started differently - my JSON endpoint did not accept correctly certain data. I started looking - and turns out, if .Net string contains '\uXXXX' symbol - then it's not being understood by JSON serializer, by console window and even by debug window in Visual Studio. But if I replace this \uXXXX notation with actual symbol - then everything starts to work.
Example: \u0092
equals to ’
- according to https://www.charbase.com/0092-unicode-private-use-two
if I run this code:
void Main()
{
var s = "test\u0092";
Console.WriteLine(s);
Console.WriteLine(JsonConvert.SerializeObject(s));
s = s.Replace('\u0092', '’');
Console.WriteLine(s);
Console.WriteLine(JsonConvert.SerializeObject(s));
}
the output would be
or if I copy/paste it here from the console, I get
test
"test"
test’
"test’"
but why output is not identical? What am I missing here?