Solved Generate xml file with encoding "UCS-2 LE BOM"?
-
I am trying to create an xml file with the encoding "UCS-2 LE BOM" in Qt. How do I do so?
-
@ablan said in Generate xml file with encoding "UCS-2 LE BOM"?:
How do I do so?
See QTextCodec (UTF-16LE)
-
Hi @Christian-Ehrlicher
I set the codec to UTF-16LE but the generated xml file when shown from Notepad++ is "UCS-2 Little Endian". -
@ablan
What's the problem?
Little Endian = LE -
@Bonnie
Yes, but it is not showing as "UCS-2 LE BOM". -
@ablan
My notepad++ doesn't have a "UCS-2 LE BOM"...It only has "UTF-8 BOM"
I think LE/BE means it already has BOM...
Without the BOM, how would it know the file is LE or BE?
So it doesn't need to add "BOM" to these two UCS-2 codecs' name... -
I have found the solution. When using QTextStream, use setGenerateByteOrderMark(true) and codec to "UTF-16LE", the output will then show as "UCS-2 LE BOM".