I\'m trying to access an API I made in PHP. It works fine in browser, but I can\'t get this code to fetch any sort of data from any given webpage.
var jsonDa
the code is correct but the data isn't in UTF it seems so it fails to make the NSString.
fails in swift & objC
for that server data is in NSISOLatin2StringEncoding
it differs based on the HTTP endpoint and normally UTF8 is fine
var jsonData: NSData = NSData(contentsOfURL: NSURL(string: "https://www.google.com"))
let string1 = NSString(data: jsonData, encoding: NSISOLatin1StringEncoding)
println(string1)
shows the page's sourcecode