【发布时间】:2019-01-14 17:26:04
【问题描述】:
我有一个创建标题的基本应用服务。当我的客户端页面使用特殊字符将参数值传递给我的服务器端函数时,会出现问号。
请问我该如何解决这个问题?
我当前的代码。
index.js
var title = "Búsq"
titleService.CreateTitle(title).success(function (data) {
vm.title= data;
});
TitleAppService.cs
public string CreateTitle(string title)
{
// title is received here as B�sq <- how do I resolve this, it should be Búsq
}
【问题讨论】:
-
title参数是否有可能在入口路径中传递(作为query string参数)?因为如果是这样 - 它应该首先被编码 -
@ymz 任何关于编码的提示将不胜感激
-
你是如何将 index.js 存储在磁盘上的?尝试使用 utf-8 编码存储 index.js
标签: javascript c# angularjs