QSettings* configInfo= newQSettings("config.ini", QSettings::IniFormat);// 读取配置文件configInfo->setIniCodec("utf-8");// 解决乱码QString result = configInfo->value("/config/key").toString();// 读取值 其中:“configInfo->setIniCodec("utf-8");// 解决乱码” 这句话是关键点,同时我...
QSettings* configInfo= new QSettings("config.ini", QSettings::IniFormat); // 读取配置文件 configInfo->setIniCodec("utf-8");// 解决乱码 QString result = configInfo->value("/config/key").toString(); // 读取值 1. 2. 3. 其中:“configInfo->setIniCodec("utf-8");// 解决乱码” 这...
输入文件路径,文件格式QSettings *setting =newQSettings(fileName , QSettings::IniFormat);//设置文件编码,配置文件中使用中文时,这是必须的,否则乱码setting->set
String strLine, value = ""; BufferedReader bufferedReader = new BufferedReader(new FileReader(URLDecoder.decode(file, "UTF-8"))); //解决中文路径乱码 boolean isInSection = false; try { while ((strLine = bufferedReader.readLine()) != null) { strLine = strLine.trim(); strLine = strL...