What you probably want here is - right at the start:
opt.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping;
(obviously don't change this constantly - set it once only; if a different usage needs different options: use a different options object)
This leaves the Name
unescaped, rather than escaping it in the JSON. From there, you can then encode the string
any way you like.
You should also note that the name UnsafeRelaxedJsonEscaping
suggests that there may be scenarios in which this is undesirable, so: it would be worth trying to read the documentation on UnsafeRelaxedJsonEscaping
to understand when and why this is.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…