http下载时中文文件名乱码解决方法: 把编码转换为 iso8859-1 java,和oc同个处理方法
原地址
[url]http://stackoverflow.com/questions/6730052/how-to-convert-iso-8859-1encoded-string-into-utf-8-in-objective-c[/url]
//http下载时中文文件名乱码解决方法,防止中文乱码 把编码转换为 iso8859-1 解决中文乱码问题
NSString *fileName = @"中文文件名";
const char* utf8String = [fileName UTF8String];
fileName = [[NSString alloc] initWithCString:utf8String encoding: NSISOLatin1StringEncoding];
原地址
[url]http://stackoverflow.com/questions/6730052/how-to-convert-iso-8859-1encoded-string-into-utf-8-in-objective-c[/url]
本文介绍了一种解决HTTP下载过程中中文文件名出现乱码的问题。通过将文件名编码从UTF-8转换为ISO-8859-1,可以有效避免中文乱码的情况发生。具体实现方式是使用Objective-C语言中的NSString类进行编码转换。
6859

被折叠的 条评论
为什么被折叠?



