问题描述
我有问题使用+ stringWithContentsOfFile:usedEncoding:错误:
我的问题在usedEncoding:(NSStringEncoding *)enc
我不知道如何设置指针编码。例如,在类似的函数中,我们编码:(NSStringEncoding)enc - 没有指针!
我想在NSString中加载文件(文件有编码ISOLatin1),并使用NSString作为UTF8String。
我该怎么做?
谢谢。
NSStringEncoding encoding;
NSError *错误;
NSString * myString = [NSString stringWithContentsOfFile:myFilePath usedEncoding:& encoding error:& error];
I've got problem with use + stringWithContentsOfFile:usedEncoding:error:
My problem in usedEncoding:(NSStringEncoding *)encI don't know how can i set pointer to encoding. If i make it - programm is fail.
For example, in similar function we have encoding:(NSStringEncoding)enc - without pointer!
I want loading file (file has encoding ISOLatin1) in NSString and use NSString as UTF8String.
how can i make it ?
thanks.
NSStringEncoding encoding;
NSError* error;
NSString* myString = [NSString stringWithContentsOfFile:myFilePath usedEncoding:&encoding error:&error];
这篇关于使用NSString + stringWithContentsOfFile:usedEncoding:error:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!