p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; min-height: 16.0px }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #00b1ff }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #4bd156 }
span.s1 { }
span.s2 { color: #ffffff }
span.s3 { color: #de38a5 }
span.s4 { color: #ff4647 }
Swiftlet str : NSString = CFURLCreateStringByAddingPercentEscapes(nil, dic, "!*‘();:@&=+$,/?%#[]" as CFString, nil, CFStringBuiltInEncodings.UTF8.rawValue) // let str : NSString = dic.addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlQueryAllowed)! as NSString // let str : NSString = dic.addingPercentEscapes(using: String.Encoding.utf8.rawValue)! // let str : NSString = dic.addingPercentEncoding(withAllowedCharacters: NSCharacterSet(charactersIn:"`#%^{}\"[]|\\<> ").inverted)!
OC //编码 - (NSString *)encode { CFStringRef strRef = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, NULL, NULL, kCFStringEncodingUTF8); return (NSString *)CFBridgingRelease(strRef); }
经过上面的编码即可加载出图片
时间: 2024-10-12 21:22:26