Exporting UTF-8 text from LibreOffice without byte order mark

In LibreOffice, if I save a document as file type "encoded text" and select "Unicode (UTF-8)" as the encoding, it always writes a byte order mark (BOM) at the start of the text. It does this even when exporting text that started out with no such mark (such as imported ISO-8859-8 text). Is there a way to suppress the generation of the BOM?

According to the Unicode docs: "Where UTF-8 is used transparently in 8-bit environments, the use of a BOM will interfere with any protocol or file format that expects specific ASCII characters at the beginning". This is exactly the problem I'm running into, as the text is going to be fed to a program that does not expect an initial BOM.


Solution 1:

There is pending 2018 patch attached to a relevant 2011 bug report

Martin van Zijl 2018-02-26 18:48:14 UTC

I created a patch for review. With this patch if you do:

1) File --> Save As...
2) Choose Type = "Text (Choose Encoding)"
3) Click "Use Text - ..."
4) In the final dialog will be a checkbox "Include byte-order-mark". If you un-check this, then the BOM will not be included in the output.

Video demo attached.

Review link: https://gerrit.libreoffice.org/#/c/50388/