Base64 encoding in Swift will not decode in Android

后端 未结 1 927
死守一世寂寞
死守一世寂寞 2021-02-09 00:50

I have an Android app which uses Base64 to encode images, and encoded strings are stored on a server. I am now making an iOS client for the same app and am struggling to make it

1条回答
  •  伪装坚强ぢ
    2021-02-09 01:18

    The Base64 provoided are from different PNG encodings. The headers are different, Android has a "sBIT" chunk and iOS has a "sRGB" chunk.

    Thus the problem is not Base64 but the representatins prpovided by the two systems.

    Decoded portions

    Android:
    âPNG

    IHDR††≠zsBIT€·O‡ÑIDAT

    iOS:
    âPNG

    IHDR»»≠XÆûsRGBÆŒÈiDOTd(ddp`ùıºIDAT

    0 讨论(0)
提交回复
热议问题