Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using NSString + stringWithContentsOfFile:usedEncoding:error:

I've got problem with use + stringWithContentsOfFile:usedEncoding:error:

My problem in usedEncoding:(NSStringEncoding *)enc I 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.

like image 681
Sergey Kopanev Avatar asked Nov 27 '09 05:11

Sergey Kopanev


1 Answers

NSStringEncoding encoding;
NSError* error;
NSString* myString = [NSString stringWithContentsOfFile:myFilePath usedEncoding:&encoding error:&error];
like image 192
Morion Avatar answered Nov 16 '22 04:11

Morion