extension String{
func decodeEnt() -> String{
let encodedData = self.dataUsingEncoding(NSUTF8StringEncoding)!
let attributedOptions : [String: AnyObject] = [
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: NSUTF8StringEncoding
]
let attributedString = NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil, error: nil)!
return attributedString.string
}
}
let encodedString = "The Weeknd ‘King Of The Fall’"
let foo = encodedString.decodeEnt() // The Weeknd ‘King Of The Fall’
QA, на который ссылается Jose Henrique Felipetto ( Установка переменных среды для доступа в PHP ), ответил на этот вопрос. Я провел закрытое голосование по своему собственному вопросу и закрыл его как дубликат
.