Skip to main content
 首页 » 编程设计

c#之使用 JSON Web 服务时出现奇怪的字符

2024年02月23日34dflying

我正在使用 WebClient.DOwnloadStringAsync 使用 JSON WebService。返回的字符串包含一些奇怪的字符对:

"start_address" : "Goethestraße 7-9, Monaco di Baviera, Germania", 

代替一些扩展字符。我怎样才能看到正确的?在示例中应该是:ß

请您参考如下方法:

自己解决了:

WebClient client = new WebClient(); 
 client.Encoding = Encoding.UTF8; // Specify the encoding here