Support for QString Unicode and ° (0xB0) - This is an invalid UTF-8 encoded byte for running character code.
Try changing the encoding of the database to UTF-8 when creating the database:
CREATE DATABASE mydb DEFAULT CHARACTER SET utf8
If it still does not work, try also with utf16.
But if you cannot change the database, you need to configure the connection parameters in the source code of the Qt application:
// db is the instance of QSqlDatabase db.setConnectOptions("ISC_DPB_LC_CTYPE=Latin1");
But this option may not be supported by the Qt Visual Fox Pro driver, since ISC_DPB_LC_CTYPE for InterBase, as shown on the page, http://doc.qt.io/archives/qt-4.7/sql-driver.html (see § QIBASE Unicode support and text encoding). I don't have Visual Foxpro documentation to find the name of the connection parameter for character encoding.
source share