iOS 解压时中文乱码

2023-07-13  本文已影响0人  胖子忧郁不起来

给文件路径加上编码

swift:

let enc = CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.GB_18030_2000.rawValue))

let path = entry.path(using: String.Encoding(rawValue: enc)!)

OC:

NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);

NSString *strPath = [NSString stringWithCString:filename encoding:enc];

上一篇下一篇

猜你喜欢

热点阅读