【发布时间】:2025-12-25 06:35:07
【问题描述】:
当我以 XML 格式返回结果时,我在数据库的某些文本中的数据中有不可见的 \u200c 字符,我的 ASP.net API 结果正确显示,但是当使用 Newtonsoft.Json 对其进行序列化时,结果中出现“\u200c”字符串。 Newtonsoft 有什么设置可以修复吗?
json:
{
"rowClass": "someData",
"fieldName": "someData",
"description": "xxxx \u200cxxxxx",
}
类:
public class Dto
{
public string RowClass { get; set; }
public string FieldName { get; set; }
public string Description { get; set; }
}
【问题讨论】:
-
请阅读How to Ask 并提供minimal reproducible example。 This sample 没有重现该问题。
标签: string asp.net-web-api formatting json.net