我有以下文字 -
❶可以添加为
以上文字在文字编辑中显示正常。但是当我尝试在NSTextView中显示相同内容时,我会得到奇怪的字符 -
可以添加为
以下是我用来在NSTextView
中显示文本的代码NSURL *url = < base URL >;
NSAttributedString *attrString = [[NSAttributedString alloc]
initWithHTML: data baseURL: url documentAttributes: (NSDictionary **) NULL];
[[textView textStorage] setAttributedString: attrString];
[attrString release];
数据设置为 -
data = NSData.FromString ("<html><head><style>p {font-size:14px;}</style></head><body><p>❶can be added </p></body></html>");