我在Alamofire 4中遇到了特殊字符的问题。
JSON包含æ,ø和å,浏览器显示它们正常,我以前的解决方案也使用SwiftyJSON。
Alamofire 4显示了这样的事情,而不是:Alamofire 4和JSON中的特殊字符
U00e6
使用此电话:
Alamofire.request(specificURL, method: .get, parameters: param, encoding: URLEncoding.default, headers: nil).responseJSON { (response: DataResponse<Any>) in
print(response)
}
怎样做才能解决这个问题?
你确定你的JSON是正确编码为utf8? –
是的,因为浏览器和我以前的解决方案与SwiftyJSON显示它没问题。 – Recusiwe
@Recusiwe检查我的答案。 –