c# - Gridview 显示不同的字符而不是 utf-8 中的字符
问题描述
我将 JSON 数据解析为具有 utf-8 字符的 gridview,但 gridview 中的数据不显示 utf-8。我在 gridview 中对列的标题进行了硬编码,它显示了 utf-8 字符。我补充说:
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" culture="en-US"/>` and `<meta http-equiv="content-
type" content="text/html; charset=utf-8" />
但它没有正确显示字符。
这是我的解析器:
public static List<Currency> ParseCurrency()
{
using (WebClient webClient = new System.Net.WebClient())
{
WebClient client = new WebClient();
var json = client.DownloadString("http://api.hnb.hr/tecajn/v2");
List<Currency> currencies =
JsonConvert.DeserializeObject<List<Currency>>(json);
Console.WriteLine(currencies.Count);
return currencies;
}
}
解决方案
推荐阅读
- tableau-api - 有条件地格式化单元格背景颜色时没有总计
- sql - PL/SQL 因为我在执行对象主体时遇到错误?
- time - 农民需要在 NetLogo 中的离散时间/刻度后更改值
- linux - 守护进程不能关闭使用 DBus 保存的 X11 屏幕吗?
- react-native - firestore 从 react native 中保存可拖动的图像
- faunadb - 从动物数据库获取对象时增加数字?
- javascript - 有没有办法将 vuejs 对象传递给 laravel 控制器?
- java - 在不知道索引的情况下确保分区表上的 SQL 搜索时间为 o(log(n))
- bash - bash 脚本中的间距存在问题
- docker - 启动容器进程导致“exec:\”uwsgi\“:$PATH 中找不到可执行文件”:未知