我正在尝试创建一个包含(')的字符串。当我发送ajax帖子以使用web服务时,发送的字符串包含\u0027。有帮助吗?
var SearchCriteria = "1=1";
if (tblSYS_SubscribersSearch.value.length > 0) {
SearchCriteria = "FirstName LIKE N'%" + Criteria + "%' OR LastName LIKE N'%" + Criteria + "%'";
}
var settings = {
"url": "<%=ConfigurationManager.AppSettings["EndPoint"].ToString()%>" + "/api/SYS_Subscriber/GetListPaged",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({
"ApiKey": Apikey,
"Fields": Fields,
"Criteria": SearchCriteria,
"SortOrder": SortOrder,
"SortDirection": SortDirection,
"PageIndex": PageIndex,
"PageSize": PageSize
}),
};
1条答案
按热度按时间zc0qhyus1#
\u0027
是撇号(')的unicode字符您需要为编码添加字符集utf-8
例子:
在html文件中,我们添加
参考:-https://www.utf8-chartable.de/