Cannot open XML files processed with QDomDocument using Microsoft Word
After processing XML files with QDomDocument and saving them like this:
Code:
if(fileName!=""){
QMessageBox::critical(this,tr
("Error"),tr
("Could not open file"));
}else{
QString fdt
=FDTemplate
->toString
();
fdt.toStdString();
stream<<fdt;
stream.flush();
file.close();
}
the files cannot be opened using Word or FrameMaker. Frame maker error is "Invalid byte"(funky signs)" of a -byte sequence". Does anyone know
what is going on? The files look fine when i open them with NotePad and NotePad++...
I read somewhere that this might be casued by QString and I've tried to convert it to std::string using .toStdString() before sending to QTextStream, but that did no help.
Re: Cannot open XML files processed with QDomDocument using Microsoft Word
Something is the output file is unexpected. We cannot see the file so we cannot tell you what.
You should not need to use a QTextStream or convert to QString or std::string... just use QDomDocument::toByteArray() and QIODevice::write()
Re: Cannot open XML files processed with QDomDocument using Microsoft Word