#includeint main() { QSettings settings("mycompany", "myapp"); settings.setIniCodec("UTF-16"); //setting the ini file codec to UTF16 return 0; }
#includeIn this example, an instance of QSettings class is created with the constructor that takes the format, scope, organization name, and application name as arguments. The setIniCodec function is called to set the encoding codec of the ini file to ISO 8859-1. The fileName function is called to get the name of the settings file. Package library: Qt Core library#include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QSettings settings(QSettings::IniFormat, QSettings::UserScope, "mycompany", "myapp"); settings.setIniCodec("ISO 8859-1"); //setting the ini file codec to ISO 8859-1 qDebug() << settings.fileName(); //get the name of the settings file return a.exec(); }