title: Unicode characters become question marks (C++ and MFC Dialog Based App)
body: <p>These codes sets the values to editbox. But I'm having trouble when I retrieve Unicode characters from MySQL table.</p>
  
  <p>For example, string <code>nüşabə</code> sets as <code>nÃ¼ÅŸabÉ™</code>.</p>
  
  <p>Here is my codes.</p>
  
  <pre><code>void CmysqlDlg::OnBnClickedButton3()
  {
      USES_CONVERSION;
  
      try
      {
          mysql::MySQL_Driver *driver = new mysql::MySQL_Driver;
          Connection *dbConn;
          Statement *st;
          ResultSet *res;
  
          driver = mysql::get_mysql_driver_instance();
          dbConn = driver-&gt;connect("tcp://127.0.0.1:3306", "root", "connection");
          dbConn-&gt;setSchema("mfc_app_database");
  
          st = dbConn-&gt;createStatement();
          res = st-&gt;executeQuery("SELECT password FROM users WHERE id=1");
          string z;
          while (res-&gt;next())
          {
              //k = res-&gt;getString("username");
              //cs.Format(_T("%s"), k);
              //CString cs(k.c_str(), CP_UTF8);
              //combo.AddString(cs);
              //usernameData.SetWindowTextW(cs);
  
              z = res-&gt;getString("password");
              CString pass(z.c_str()/*, CP_UTF8*/);
              nameData.SetWindowTextW(pass);
          }
  
  
          delete res;
          delete st;
          delete dbConn;
          delete driver;
      }
      catch (exception e)
      {
          ofstream file("sadaasad.txt");
          file &lt;&lt; e.what();
          file.close();
      }
  }
  </code></pre>
  
  <p>Database collation is set to <code>utf8_general_ci</code>.
  Actually I don't know what I should do... Brain stopped...</p>
  
  <p>Please help. Thanks.</p>