title: Reading cyrillic from Console C++
body: <p>I'm trying to read cyrillic( "Иванчо говори само глупости") from the console, but everything I get is "????". For the first time i write on C++ and I will be very greatful if someone help me to solve this problem.</p>
  
  <p>This is my code</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  #include&lt;map&gt;
  #include&lt;Windows.h&gt;
  #include&lt;clocale&gt;
  
  using namespace std;
  
  bool CheckLetters(int letter)
  {
      SetConsoleCP(1251);
      SetConsoleOutputCP(1251);
  
      bool isCyrillic = ('\u0410' &lt;= letter &amp;&amp; letter &lt;= '\u044f');
      if ((letter &gt;= 'a' &amp;&amp; letter &lt;= 'z')
          || (letter &gt;= 'A' &amp;&amp; letter &lt;= 'Z')
          || isCyrillic)
      {
          return true;
      }
      return false;
  }
  
  int main()
  {
      string input;
      map&lt;unsigned char, int&gt; letters;
  
      getline(cin, input);
  
      for (int i = 0; i &lt; input.size(); i++)
      {
          unsigned char currentLetter = input[i];
          if (CheckLetters(currentLetter))
          {
              map&lt;unsigned char, int&gt;::iterator elementIter = letters.find(currentLetter);
              if (elementIter == letters.end())
              {
                  letters[currentLetter] = 1;
              }
              else
              {
                  letters[currentLetter] ++;
              }
          }
  
      }
  
      for (map&lt;unsigned char, int&gt;::iterator current = letters.begin();
           current != letters.end(); current++)
      {
          pair&lt;unsigned char, int&gt; currentElement = *current;
          cout &lt;&lt; currentElement.first &lt;&lt; " " &lt;&lt; currentElement.second &lt;&lt;endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xaTCm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xaTCm.png" alt="enter image description here"></a></p>