1. What is the default character encoding used by GNU Emacs 25.1.1 to save files? Is it UTF-8?

  2. Assuming that it is UTF-8, does Emacs insert a BOM at the beginning of the file?

1 Answer 1


It depends.

Chapter 22.2 Language Environments of the Emacs Manual is the best place to start. The language environment controls how files are read and written, how input is handled, etc. The default is to look at the LC_ALL/LC_CTYPE/LANG environment variables and pick a language environment based on the values found there. That means that the default is to try to do the same thing the rest of your system is configured to do. Probably that means you'll be in the ASCII or UTF-8 language environment, but it could be others.

I don't really know how Emacs treats the BOM if it finds one in a UTF-8 file. I would expect it to just ignore it (not display it, not add it if it's not there, not remove it if it is), but I don't see anything that states that explicitly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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