Why does emacs sometimes insert weird characters at the top of my file? Why does emacs sometimes insert weird characters at the top of my file? unix unix

Why does emacs sometimes insert weird characters at the top of my file?


Are you running Emacs in the shell or under X? That looks like a terminal problem (similar to the escape sequences you see if your terminal doesn't like your cursor keys et al.)


Perhaps it's unicode byte order mark? What does C-h vbuffer-file-coding-system say? If it's something that ends with "with-signature" (e.g., utf-8-with-signature), then set it to the none "with-signature" version (M-xset-buffer-file-coding-system Enter utf-8).