title: How to convert a string of russian cyrillic letters?
body: <p>I parsing mp3 tags. </p>
  
  <p><code>String artist</code>  - I do not know what was on the encoding</p>
  
  <p><code>Ïåñíÿ ïðî íàäåæäó</code> - example string in russian <code>"Песня про надежду"</code></p>
  
  <p>I use <a href="http://code.google.com/p/juniversalchardet/">http://code.google.com/p/juniversalchardet/</a></p>
  
  <p>code:</p>
  
  <pre><code>String GetEncoding(String text) throws IOException {
          byte[] buf = new byte[4096];
  
  
          InputStream fis = new ByteArrayInputStream(text.getBytes());
  
  
          UniversalDetector detector = new UniversalDetector(null);
  
          int nread;
          while ((nread = fis.read(buf)) &gt; 0 &amp;&amp; !detector.isDone()) {
              detector.handleData(buf, 0, nread);
          }
          detector.dataEnd();
          String encoding = detector.getDetectedCharset();
          detector.reset();
          return encoding;
      }
  </code></pre>
  
  <p>And covert</p>
  
  <p><code>new String(text.getBytes(encoding), "cp1251");</code> -but this not work.</p>
  
  <p>if I use utf-16</p>
  
  <p><code>new String(text.getBytes("UTF-16"), "cp1251")</code> return "юя П е с н я п р о н а д е ж д у" space - not is char space</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>this first read bytes</p>
  
  <pre><code>byte[] abyFrameData = new byte[iTagSize];
  oID3DIS.readFully(abyFrameData);
  ByteArrayInputStream oFrameBAIS = new ByteArrayInputStream(abyFrameData);
  </code></pre>
  
  <p>String s = new String(abyFrameData, "????");</p>