1
I’m having a lot of problems with encoding my app. I have an online radio in the United States and I’m trying an app for it. I get the music from Lastfm.
let queryURL: String
if useLastFM {
queryURL = String(format: "http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=%@&artist=%@&track=%@&format=json", apiKey, track.artist, track.title)
} else {
queryURL = String(format: "https://itunes.apple.com/search?term=%@+%@&entity=song", track.artist, track.title)
}
let escapedURL = queryURL.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
CENTOVA says it sends in UTF8, but I can not solve it.
When I use:
@IBAction func testeS(_ sender: Any) {
let musica = self.track.title
print(musica)
}
I get Output like this for example:
Direção do vento Part César Menotti
I tried anyway, but I assume I don’t have complete mastery of SWIFT, I’m studying! Thanks to those who read/helped/collaborated with my question.