Fetch the repository succeeded.
使用远程请求过程中,如果目标地址响应报文内容格式为 charset=gbk
且包含中文,则反序列化后出现乱码。
public class GetAaddrOutput
{
public string Ip { get; set; }
public string pro { get; set; }
public string proCode { get; set; }
public string city { get; set; }
public string cityCode { get; set; }
public string region { get; set; }
public string regionCode { get; set; }
public string addr { get; set; }
public string regionNames { get; set; }
public string err { get; set; }
}
var result = await "http://whois.pconline.com.cn/ipJson.jsp?json=true".GetAsAsync<GetAaddrOutput>();
xxxAsStreamAsync
方法返回签名,除了返回 Stream
以外还返回 Encoding
编码xxxAsAsync<T>
包含 gbk
中文序列化乱码问题// 返回元组
var (stream, encoding) = await "https://www.furion.icu/".GetAsStreamAsync();
// 包含序列化正常
var result = await "http://whois.pconline.com.cn/ipJson.jsp?json=true".GetAsAsync<GetAaddrOutput>();
https://gitee.com/dotnetchina/Furion/commit/258a9b3432bba909778c8c22408f8d787841f330
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Sign in to comment