难道有人要告诉我,如何用档案来挽救 by令标记? 例如,现在我只保存一个文本文件:
NSString *currentFileContent = @"This is a string of text to represent file content.";
NSString *currentFileName = @"MyFileName";
NSString *filePath = [NSString stringWithFormat:@"%@/%@.%@", [self documentsDirectory], currentFileName, rtf];
[currentFileContent writeToFile:filePath atomically:YES encoding:NSUTF16StringEncoding error:&error];
My understanding of BOM is:
The BOM character is the "ZERO WIDTH NO-BREAK SPACE" character, U+FEFF, in the Unicode character set.
I have an iPhone application that allows users to save text to an RTF file. All works fine if I use NSUTF8StringEncoding, unless the user has double-byte characters such as Japanese, or Chinese. The simple answer would seem to be saving the file with NSUTF16StringEncoding which is allowed in more recent RTF specs, except that Microsoft Word can only automatically open UTF-16 files if a BOM is defined.
我希望,如果我能够建立一个通用的管理局,我就没有必要确定用户的特性,因为我无法知道什么是事先的。 但是,他们仍然能够以双重特点打开区域工作队的档案。
感谢建议或见解。