title: Java char set encoding problem(from UTF8 to cp866)
body: <p>How to convert text from utf8/cp1251(windows cyrillic) to DOS Cyrillic (cp866)</p>
  
  <p>I find this example:</p>
  
  <pre><code>Charset fromCharset = Charset.forName("utf8");
  Charset toCharset = Charset.forName("cp866");
  
  String text1 = "Николай"; // my name in bulgarian
  String text2 = "Nikolay"; // my name in english
  
  System.out.println("TEXT1 :[" + toCharset.decode(fromCharset.encode(text1)).toString() + "]");
  System.out.println("TEXT2 :[" + toCharset.decode(fromCharset.encode(text2)).toString() + "]");
  </code></pre>
  
  <p>And the input is:</p>
  
  <pre><code>TEXT1 :[╨Э╨╕╨║╨╛╨╗╨░╨╣] // WRONG
  TEXT2 :[Nikolay]  // CORRECT
  </code></pre>
  
  <p>Where is the problem?</p>