1

I've saved files with different encodings using TextEdit. After closing the file, with a vim editor, I open the file and type the following to test for the existence of a byte order mark:

:setlocal bom?

no bom is detected for any encoding.

This script seems to directly create BOMs ok.

#!/usr/bin/env bash
printf '\xEF\xBB\xBF' > withBom.txt

But, I'd like to use a more reliable technique than that to create files with BOM. I don't understand what is going on with TextEdit.

0

1 Answer 1

1

If I remember right, it's not possible in TextEdit. For BOM you need to use a more serious editor like BBEdit:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .