IOSencode解码与编码

/**decode编码*/
- (NSString *)encodeToPercentEscapeString
{
    NSString*
    outputStr = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(
                                                                             
                                                                             NULL, /* allocator */
                                                                             
                                                                             (__bridge CFStringRef)self,
                                                                             
                                                                             NULL, /* charactersToLeaveUnescaped */
                                                                             
                                                                             (CFStringRef)@"!*'();:@&=+$,/?%#[]",
                                                                             
                                                                             kCFStringEncodingUTF8);
    
    
    return
    outputStr;
}
/**decode解码*/
- (NSString *)decodeFromPercentEscapeString
{
    NSMutableString *outputStr = [NSMutableString stringWithString:self];
    [outputStr replaceOccurrencesOfString:@"+"
                               withString:@""
                                  options:NSLiteralSearch
                                    range:NSMakeRange(0,[outputStr length])];
    return
    [outputStr stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}

网页标题:IOSencode解码与编码
URL网址:http://bzwzjz.com/article/ggspgj.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站设计 成都商城网站建设 定制网站制作 网站制作公司 成都网站设计制作公司 网站建设方案 网站建设公司 成都网站建设 成都网站设计 H5网站制作 公司网站建设 手机网站建设 企业网站设计 成都网站建设推广 外贸营销网站建设 成都网站建设 高端网站建设 成都响应式网站建设 定制网站设计 成都企业网站建设公司 成都网站建设 成都网站制作公司