I have the following text -
❶can be added as
The above text shows up fine in Text Edit. But when I try displaying the same in NSTextView, I get strange characters -
â¶can be added as
The foll开发者_如何转开发owing is the code that I am using to display the text in NSTextView
NSURL *url = < base URL >;
NSAttributedString *attrString = [[NSAttributedString alloc]
initWithHTML: data baseURL: url documentAttributes: (NSDictionary **) NULL];
[[textView textStorage] setAttributedString: attrString];
[attrString release];
data is set as -
data = NSData.FromString ("<html><head><style>p {font-size:14px;}</style></head><body><p>❶can be added </p></body></html>");
精彩评论