纯文本预览不能正确显示特殊字符

时间:2012-11-26 20:50:37

标签: ios preview diacritics print-preview

我有一个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,它看起来也不错。关于纯文本预览的内容已关闭。

有什么建议吗?感谢。

0 个答案:

没有答案