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 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题
  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求
  • ¥20 antv g6 折线边如何变为钝角
  • ¥30 如何在Matlab或Python中 设置饼图的高度
  • ¥15 nginx中的CORS策略应该如何配置
  • ¥30 信号与系统实验:采样定理分析
  • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao