我在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檢查我的答案。 –