title: Replacement for QTextCodec::setCodecforCStrings in Qt5
body: <p>I have a lot of legacy that was making use of QTextCodec::setCodecForCStrings to handle other languages such as portuguese, swedish and italian. I know of this solution:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/13968734/qtextcodecsetcodecforcstrings-is-gone-in-qt5">QTextCodec::setCodecForCStrings is GONE in Qt5</a></li>
  </ul>
  
  <p>And have also read that blog</p>
  
  <ul>
  <li><a href="http://www.macieira.org/blog/2012/05/source-code-must-be-utf-8-and-qstring-wants-it/" rel="nofollow noreferrer">http://www.macieira.org/blog/2012/05/source-code-must-be-utf-8-and-qstring-wants-it/</a></li>
  </ul>
  
  <p>but it does not help at all. The fact that this function is gone really is a dealbreaker for me.</p>
  
  <p>I have considered writing my own QString class or copying the source code for SetCodecForCStrings and adapting it for Qt5. I will deal with cross-platform issues (it was already dealt with anyway).</p>
  
  <p>Has anyone tried this ? If so what problem did you encounter ? Is there anything already made that could be used instead (library, wrapper, adapter) ? I do not mind paying for it if I need to. Or maybe I just have to stick with qt4 but I really like the new connect syntax...</p>
  
  <p>Edit :</p>
  
  <pre><code>int main(int argv, char** args)
  {
    // Create test application.
    QApplication application(argv, args);
  
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB18030-0"));
  
    //My main form shown here
  
    return application.exec();
  }
  </code></pre>