美文网首页
url 中文字符处理

url 中文字符处理

作者: 管乐_VICTOR | 来源:发表于2018-06-13 18:27 被阅读44次

    加密或者url中文字符或者特殊符号的处理,不是全部,只是对特殊符号的处理。

        NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"!#$%&'()*+,/:;=?@[]"] invertedSet];
        NSString *encodedUrl = [str1 stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];
    

    相关文章

      网友评论

          本文标题:url 中文字符处理

          本文链接:https://www.haomeiwen.com/subject/szhseftx.html