我在C项目中为iOS项目使用什么类型的文件名字符串?

wxs*_*wxs 7 c string objective-c

我有一个我在iOS Objective-C程序中使用的C库.我的C库的一个功能是读入并处理文件中的数据.目前该功能看起来像这样

internalType* parseFile(const char* filename);
Run Code Online (Sandbox Code Playgroud)

在iOS上传递一个char*作为这个安全的文件名,还是我用unicode拍摄自己的脚?这里有首选做法吗?

jus*_*tin 3

很可能是UTF-8。为了安全起见,您应该使用CFURLGetFileSystemRepresentationURL 和-[NSString fileSystemRepresentation]路径。