• 访问URL时,需要对字符串进行转码:

    urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
  • 系统会默认保留一些字符,此时若想将这些字符转换,将上述方法变为

    urlStr = [urlStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^+{}\"[]|\\<> "].invertedSet];
    

相关文章:

  • 2021-12-30
  • 2021-05-20
  • 2022-12-23
  • 2022-03-09
  • 2022-03-07
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-02-17
  • 2022-03-02
  • 2022-12-23
相关资源
相似解决方案