【发布时间】:2020-05-03 07:09:51
【问题描述】:
Twitter API 响应:
"retweet_count" = 0;
retweeted = 0;
source = "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>";
text = "ALTIN alm\U0131\U015f ba\U015f\U0131n\U0131 gidiyor... bakal\U0131m t\U00fcrk liras\U0131 daha ne kadar de\U011fersizle\U015fecek @Turkiye @BorsaAltin\U2026 https://twitter.com/i/web/status/1216306036602277889";
truncated = 1;
我的代码:
let request = client.urlRequest(withMethod: "GET", urlString: statusesShowEndpoint, parameters: params, error: &clientError)
client.sendTwitterRequest(request) { (response, data, connectionError) -> Void in
if connectionError != nil {
print("Error: \(connectionError)")
}
do {
let json = try JSONSerialization.jsonObject(with: data!, options: [])
print("json: \(json)")
} catch let jsonError as NSError {
print("json error: \(jsonError.localizedDescription)")
}
}
}
如何将 Unicode 转换为字符串?我一直不使用模型。
【问题讨论】: