Say you have an ISO-8859-1 encoded string in a varaible isoString type const char* , then you can create an NSString instance as follows:
NSString* str = [[NSString alloc] initWithCString: isoString encoding: NSISOLatin1StringEncoding];
Note. The encoding of Latin-1 and ISO-8859-1 is the same.
Using the following code, you can convert it to a C string with UTF-8 encoding if necessary:
const char* utf8String = [str UTF8String];
source share