Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call C# functions from anywhere using URL (HTTP server)
#27
Why it's a problem?

It is how JsonSerializer.Serialize works by default. But can be changed.

Code:
Copy      Help
using System.Text.Json;
print.it(JsonSerializer.Serialize(new { text = "ąč" }));
print.it(JsonSerializer.Serialize(new { text = "ąč" }, new JsonSerializerOptions(JsonSerializerDefaults.Web) { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping }));


Messages In This Thread
RE: Call C# functions from anywhere using URL (HTTP server) - by Gintaras - 05-12-2024, 07:45 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)