I fixed this by using the following

Qt Code:
  1. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB18030")); //gb18030 was the encoding of the data.
  2.  
  3. //then using a query to retrieve the data, and display like below
  4. QString str = query.value(0).toString().toUtf8(); //this would show a correct encoding of the data!
To copy to clipboard, switch view to plain text mode