4
I want to change the default text encoding used by LibreOffice when saving a document as a Text document. Where can I find this setting?
I want it to be UTF-8 WITHOUT the BOM, which I believe is called ASCII/US in LibreOffice.
I do know that there is a Text encoded option where you can (in theory, if it actually worked) choose the encoding of each plain file. I have three problems with this:
- It doesn't properly work. I.e. most of the time it doesn't show any popup where you can choose the encoding and just saves as if you chose the Text option. Maybe once in ten trials it shows the popup.
- I only edit plain text files and I use LibreOffice only for spellchecking (and counting words). All the files I will ever want to write should be UTF-8 encoded without the BOM, so I'd like to avoid wasting time everytime by manually selecting this option.
- If I have a file correctly encoded in UTF-8 without the BOM, and I then try to save it using, for example, Ctrl+S then the file will be automatically saved using the Text default encoding which saves the file as UTF-8 with BOM which breaks the file. LibreOffice should preserve the encoding of the file and save the file as UTF-8 without the BOM. Having to use Save As every single time is a real waste of time.
1Do you have any idea why LibreOffice is going against the Unicode Standard by adding the BOM for utf-8? Quote: "Use of a BOM is neither required nor recommended for UTF-8". This makes it extremely hard to use such files with other programs (e.g. pdfLaTeX in my case). – Bakuriu – 2016-07-19T09:19:24.193
By the way, the macro you have written saves with the BOM right? So it's useless. – Bakuriu – 2016-07-19T09:21:09.030
1
Yes, it does save with the BOM. As stated in the answer, you could use the macro and then run a tool such as
– Jim K – 2016-07-19T09:46:02.930iconv
to remove the BOM. Or, write a complete solution in Python or Java. I could do it except that this website is not a code writing service, so instead this answer points toward possible solutions.Regarding how LibreOffice is designed, I do not know the motivation behind the decision. – Jim K – 2016-07-19T09:46:09.867