Is it possible to correctly decode using Swift language base64 encoded string which contains a string in non-utf8 encoding (ie. Windows-1252 or ISO-8859-1)?
Every snippet of code that can be found here on stackoverflow fails and return nil.
For example
let decodedData = NSData(base64EncodedString: base64String, options:NSDataBase64DecodingOptions.IgnoreUnknownCharacters)
gives empty as it ignores bad characters and if I don't use this option it gives nil like dozens of other gist code
This is test base64 string containing part of cryptographic key which I need to decode. If I use some other language like Python, PHP or Java it is decoding correctly but using Swift I can't do that.
FkXKDAAAAAAAAAAAvMBAYFk1JADmiwHAz+rNFy93faklHL7MW3Hhlf1Bo7/hpZ3j1GmdySyIpJ4YlRH65mleumYqsgUgYLlQY/jQq2YykMPUwZQ4jTgU7Q==
should be EʼÀ@`Y5$æ‹ÀÏêÍ/w}©%¾Ì[qá•ýA£¿á¥ãÔiÉ,ˆ¤ž•úæi^ºf*² `¹PcøÐ«f2ÃÔÁ”88í
as it can be decoded with online tool like this
Here is another one:
FgdhDAAAAAAABwAAOJAiYMxlJQAMbwHAWrYq59+po4WdMS4R+EHV4hBKzWn8oZYpTFdFQ33usZUa19d+umkWcL2g4mmVeUOwUG2dZGWIrxlTWJA+s/RTTQ==
Please advise is there any way to decode base64 strings like this locally on iOS device or I really need to send it to server to do that?