Hi guys,
I read some content from a file and save it as html, then i use the QWebView::load to load that html, however, some character is not displayed correctly. The steps and code are as follows:
1. read content:
2. save content as htmlCode:QFile file1("a7.xml"); if (file1.open(QFile::ReadOnly)){ QTextStream in(&file1); in.setCodec("UTF-8"); QString temp,fileContent; do { temp = in.readLine(); fileContent= fileContent+temp; } while (!temp.isNull()); } ...
3. load htmlCode:QFile file("test.html"); if(!file.exists) { if (file.open(QIODevice::WriteOnly)){ QTextStream out(&file); out.setCodec("UTF-8"); out << fileContent<< "\n"; file.close(); } }
the content has the following characters: geïnitieerd “extra korting op locatie”Code:webview->load(QUrl("test.html"));
I am out of solution to solve this problem and someone can help me??
Regards,
Zhengtao



