What alternative for atob on ios?

后端 未结 1 1112
旧巷少年郎
旧巷少年郎 2021-01-23 23:58

In my Ionic application I use the atob() command.

It works fine on chrome & android, but for some reason it does not work on iOS, is there an alternative?

相关标签:
1条回答
  • 2021-01-24 00:51

    In IOS, atob does not accept space characters. So use atob like that:

    var input = response.data.content;
    input = input.replace(/\s/g, '');
    var content = window.atob(input);
    

    Have a look at that answer about atob

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