title: How to determine string encoding in cocoa?
body: <p>How to determine string encoding in cocoa?
  Recently I'm working on a radio player.Sometimes id3 tag text was garbled. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>CFDictionaryRef audioInfoDictionary;
  UInt32 size = sizeof(audioInfoDictionary);
  result = AudioFileGetProperty(fileID, kAudioFilePropertyInfoDictionary, &amp;size, &amp;audioInfoDictionary);
  </code></pre>
  
  <p>ID3 info are in audioInfoDictionary. Sometimes the id3 doesn't use utf8 encoding, and title, artist name were garbled.</p>
  
  <p>Is there any way to determine what encoding a string use?</p>
  
  <p>Special thx!</p>