title: How to display accented characters using NSMutableAttributedString?
body: <p>In my <code>NSString</code>, I've some accented characters and html tags, such as <code>&lt;i&gt;&lt;/i&gt;</code>. I want to display them in <code>NSTextField</code> with text attributes to them.</p>
  
  <p>When I build the attrStr, I use:</p>
  
  <pre><code>NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithHTML:[text dataUsingEncoding:NSUTF8StringEncoding]
                                                                     options:@{NSWebPreferencesDocumentOption : webPreferences}
                                                          documentAttributes:NULL];
  </code></pre>
  
  <p>I display the text as follow:</p>
  
  <pre><code>someTextField.attributedStringValue = attrStr;
  </code></pre>
  
  <p>But this require I know the encoding of the <code>NSString</code>, but the problem is that I do not know the encoding.  So how do I build an attribute string without knowing the encoding?</p>