title: Java. Why does it work differently with english and slavic characters?
body: <p>I've found a rather strange thing for me while working with Java. Maybe it's an ordinary thing, but i don't understand why it works this way.</p>
  
  <p>I have a code like this:</p>
  
  <pre><code>Character x = 'B';
  Object o = x;
  System.out.println(o == 'B');
  </code></pre>
  
  <p>It works fine and the output is "true".
  Then I change the english B to slavic B (Б):</p>
  
  <pre><code>Character x = 'Б';
  Object o = x;
  System.out.println(o == 'Б');
  </code></pre>
  
  <p>Now the output is "false". How come?
  By the way, the output is still "true" if i compare the x variable with 'Б' directly, but when I do it through an Object it works differently.</p>
  
  <p>Can anyone, please, explain this behaviour?</p>