title: getting a sub string of a std::wstring
body: <p>How can I get a substring of a <code>std::wstring</code> which includes some non-ASCII characters?</p>
  
  <p>The following code does not output anything:<br>
  (The text is an Arabic word contains 4 characters where each character has two bytes, plus the word "Hello")</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      wstring s = L"سلام hello";
      wcout &lt;&lt; s.substr(0,3) &lt;&lt; endl;
      wcout &lt;&lt; s.substr(4,5) &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>