Background
The recent development of the dictionary software found that offline package audio can not be played in iOS 10.3, after investigation found that iOS 10.3 used Apple's new file system APFS, and APFS does not support the majority of non-English characters similar (zi? Ca?n xi?ng hui?). Cause ssziparchive Unable to extract the bands of the file. The program does not have any exceptions during the entire decompression process. Finally, the problem is that iOS 10.3 uses the APFS system on the fopen () to not open the bands file name, and the entire process does not have any error messages and exception warnings.
Official introduction
APFS is currently unusable and most non-english languages.
The time had come to test out my fears over problems with file and folder names Inapple ' s new filing system, APFS. The TL;DR is, Apfs is isn't currently safeto use with names which might has Unicode normalisation Issues–which meansi T is safe with a limited ASCII character set, as shown in the Bizarrescreen shot above.
Solution Solutions
When a fopen () is used, if the current file has a special character, use Nsfilemanager to modify the current filename, using the Cfstringconvertencodingtonsstringencoding renames the current file name through kcfstringencodinggb_18030_2000 . Use Nsfilemanager to rename the restore after fopen () has been manipulated.
Resolving code References
1- (void) Testfopen: (nsstring*) FullPath {2 //Start3FILE *FP = fopen ((Const Char*) [FullPath utf8string],"WB");4NSString *tmpfullpath =Nil;5 //determines whether a file is created, without using temporary file names for processing6 if(![[Nsfilemanager Defaultmanager] Fileexistsatpath:fullpath]) {7 fclose (FP);8 //Working with temporary file names9NSString *dir =[FullPath stringbydeletinglastpathcomponent];TenNSString *tmpfilename =[FullPath lastpathcomponent]; OneNsstringencoding enc =cfstringconvertencodingtonsstringencoding (kcfstringencodinggb_18030_2000); ATmpfilename =[NSString stringwithcstring:[tmpfilename utf8string] encoding:enc]; -Tmpfullpath =[dir stringbyappendingpathcomponent:tmpfilename]; -fp = fopen ((Const Char*) [Tmpfullpath utf8string],"WB"); the } - //FP Todo - //... - + //End - fclose (FP); + if(Tmpfullpath &&[[Nsfilemanager Defaultmanager] Fileexistsatpath:tmpfullpath]) { A //using rename restore at [[Nsfilemanager Defaultmanager] Moveitematpath:tmpfullpath topath:fullpath Error:nil]; - } - if([[[Nsfilemanager Defaultmanager] Fileexistsatpath:fullpath]) { -NSLog (@"file exist"); - } -}
Resources
https://eclecticlight.co/2017/04/06/apfs-is-currently-unusable-with-most-non-english-languages/
IOS 10.3 APFS does not support most non-English character solutions