I have a C library that I’m using from within an iOS Objective-C program. One of the functions of my C library reads in and processes data from a file. Currently that function looks something like this
internalType* parseFile(const char* filename);
Is passing in a char* for the filename like this safe on iOS or am I shooting myself in the foot with unicode? Is there a preferred practice here?
It’s likely UTF-8. To be safe, you should use
CFURLGetFileSystemRepresentationfor URLs and-[NSString fileSystemRepresentation]for paths.