1

我有一个 UTF8 文件,我通过 UIDocumentInteractionController 向用户显示预览。在预览中,诸如变音符号 ä(上面有两个点的 a)等特殊字符无法正确显示。它看起来像一个大写字母 A,旁边有一个框:ä

文件保存如下:

[plainTextContents writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil];

并通过以下方式显示:

NSURL *pathURL = [NSURL fileURLWithPath:path];
UIDocumentInteractionController* docController = [UIDocumentInteractionController interactionControllerWithURL:pathURL];
docController.delegate = parentViewController;

如果我在 Mac OS X 上打开保存的文件,特殊字符会按预期显示。如果我在 iPad 上预览文件的 RTF 版本,也使用 NSUTF8StringEncoding 保存,它看起来也很好。有一些关于纯文本预览的内容已关闭。

有什么建议么?谢谢。

4

0 回答 0