Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

When saving the file with Save As, under All Formats select Text Encoded, then Save. When the Confirm File Format dialog comes up, select Use Text Encoded Format. The ASCII Filter Options dialog then comes up. Select Western Europe(ASCII/US) and click OK. If you then examine the resulting file with a hex editor such as Bless, you will see that the BOM is gone.

share|improve this answer
2  
Well of course the BOM is gone, but the file is no longer encoded in UTF-8, either! – kreemoweet Mar 10 '14 at 16:25
    
And then none Western Europe characters as well as Western Europe characters above 127 are gone too – Lưu Vĩnh Phúc Dec 18 '14 at 14:44
    
Sorry, but this doesn't address the question at all. I need a way to export UTF-8 text from LibreOffice without a BOM. – Ted Hopp Jul 13 '15 at 21:05
    
@TedHopp well, what if you choose the option he says? Run the "file" command on the file, and see what it says. You could try editing the hex of the UTF-8 file and removing the BOM. Did you try any of that? – barlop Aug 27 '15 at 15:13
    
@barlop - The option he suggests results in garbage in the file in place of non-ASCII characters (e.g., Cyrillic, Hebrew, Greek, etc.) I fail to see how the "file" command would be useful. Editing the hex and removing the BOM might work for a file here or there, but is totally unsuitable for production work. Plus, it doesn't address my question at all: is there a way to suppress the generation of the BOM from LibreOffice? – Ted Hopp Aug 27 '15 at 17:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.