I am trying to decode a base64 string to an image in Swift using the following code:
let decodedData=NSData(base64EncodedString: encodedImageData, options: N
It's make problem with special character, but an interesting point is if we use NSData and NSString then it's working fine.
static func decodeBase64(input: String)->String{
let base64Decoded = NSData(base64Encoded: input, options: NSData.Base64DecodingOptions(rawValue: 0))
.map({ NSString(data: $0 as Data, encoding: String.Encoding.utf8.rawValue) })
return base64Decoded!! as String
}