iOS字符串中特殊字符的编码与解码

  • Post author:
  • Post category:其他




1.网络请求时url中携带@等特殊字符的解决方案



a.对url进行特殊字符编码

– (


nullable


NSString


*)stringByAddingPercentEncodingWithAllowedCharacters:(


NSCharacterSet


*)allowedCharacters


NS_AVAILABLE


(


10


_9,


7


_0);


b.对url进行特殊字符解码



版权声明:本文为Olive1993原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。