When I take a path in an NSString and turn around and use it in a C API, for example:
CGDataProviderRef CGDataProviderCreateWithFilename(const char *filename );
What is the correct encoding for the path when flattening to a char*? UTF8? (ASCII??)
I feel like this should be either obvious, or obviously documented, but I’m having trouble thinking and/or finding the answer.
Use
-[NSString fileSystemRepresentation].