duanhuan6857 2014-10-27 14:27
浏览 72

用于移动应用的Web服务的Base64编码消息问题

we are posting some message from website and displaying it on the mobile app. We are storing the message in base64 encoded format in mysql database. For mobile app we are giving the base64 encoded string, and mobile developer are doing decoding from there side and displaying the normal text. Now issue is when we are using 'enter, single quote, double quote' this characters are displayed as ' , \' and \" ' like this.

Is there any solution for this that this will displayed correctly in the android and iphone app. or what we can do this from php server side.

  • 写回答

1条回答 默认 最新

  • douxu0550 2014-10-27 14:34
    关注

    You need to use NSDataBase64EncodingEndLineWithLineFeed instead of NSDataBase64Encoding64CharacterLineLength parameter in iOS while converting base64 into normal string using base64EncodedStringWithOptions method

    NSString *strNormalText = [yourBase64Data base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
    

    Try these below parameters if needed :

    NSDataBase64Encoding76CharacterLineLength
    NSDataBase64EncodingEndLineWithCarriageReturn
    

    Note : In Android same option might be available

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!