[Qt-interest] UCS-2LE encoded content to QDomDocument?

Lingfa Yang lingfa at brandeis.edu
Sun Jan 18 03:02:03 CET 2009


Lingfa Yang wrote:
> Hello,
>
> QDomDocument fails to set content which is UCS-2Little Endian encoded 
> XML file.
>
>  QFile file(fileName);
>  if (file.open(QIODevice::ReadOnly)) {
>    QByteArray content = file.readAll();
>    file.close();
>      domDocument.setContent(content , false, &errorStr, &m_errorLine, 
> &m_errorColumn);
>    ...
>  }
>
> Is there a quick fix?
>
> Thanks in advance,
> Lingfa
>
Please find a sample file: "ucs-2le.xml" attached.



More information about the Qt-interest-old mailing list