title: Preserve non-ascii characters between std::string and QString
body: <p>In my program the user can either provide a filename on the command line or using a <code>QFileDialog</code>. In the first case, I have a <code>char*</code> without any encoding information, in the second I have a <code>QString</code>.</p>
  
  <p>To store the filename for later use (Recent Files), I need it as a <code>QString</code>. But to open the file with <code>std::ifstream</code>, I need a <code>std::string</code>.</p>
  
  <p>Now the fun starts. I can do:</p>
  
  <pre><code>filename = QString::fromLocal8Bit(argv[1]);
  </code></pre>
  
  <p>later on, I can do:</p>
  
  <pre><code>std::string fn = filename.toLocal8Bit().constData();
  </code></pre>
  
  <p>This works for most characters, but not all. For example, the word Раи́са will look the same after going through this conversion, but, in fact, have different characters.
  So while I can have a Раи́са.txt, and it will display Раи́са.txt, it will not find the file in the filesystem. Most letters work, but и́ doesnt.
  <em>(Note that it does work correctly when the file was chosen in the <code>QFileDialog</code>. It does not when it originated from the command line.)</em></p>
  
  <p>Is there any better way to preserve the filename? Right now I obtain it in whatever native encoding, and can pass-on in the same encoding, without knowing it. At least so I thought.</p>