我怎么能在swift中解码一个字符串?该字符串现在为test%2Enl,但正确的格式为test.nl.
我现在有这个:
let encodedData = encodedString.dataUsingEncoding(NSUTF16StringEncoding)!
let attributedOptions = [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]
let attributedString = NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil, error: nil)!
return attributedString.string
Run Code Online (Sandbox Code Playgroud)