title: How to output Unicode characters from hex string in C++?
body: <p>I have a string called <code>str</code> containing the hex code <code>265A</code> and I would like to output it as a Unicode character, which should be the black chess king.</p>
  
  <p>So these are the ways I have already tried:</p>
  
  <pre><code>std::string str = "\u" + str;
  std::cout &lt;&lt; str;
  </code></pre>
  
  <p>but this gives me the error</p>
  
  <pre><code>error: incomplete universal character name \u
  </code></pre>
  
  <p>Doing</p>
  
  <pre><code>std::cout &lt;&lt; "\u" &lt;&lt; str;
  </code></pre>
  
  <p>also didn't work, for the same reason.</p>
  
  <p>So I tried using <code>wchar_t</code> like this:</p>
  
  <pre><code>wchar_t wc = strtol(str.c_str(), NULL, 16);
  std::wcout &lt;&lt; wc;
  </code></pre>
  
  <p>but that just didn't output anything.</p>
  
  <p>So I really don't know what else to do.</p>