how can I make sure emacs always saves edited/created plain text as utf8?
emacs, macos
Solution
I have this in my `.emacs` (of course I copied from somewhere). I think they are straight forward to understand
(setq buffer-file-coding-system 'utf-8-unix)
(setq default-file-name-coding-system 'utf-8-unix)
(setq default-keyboard-coding-system 'utf-8-unix)
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
(setq default-sendmail-coding-system 'utf-8-unix)
(setq default-terminal-coding-system 'utf-8-unix)
Problem
I'll be opening txt files created in a lot of different encodings (from before I knew what an encoding was) in emacs. Sometimes they don't display correctly but, as it turns out, 5 seconds of find and replace is usually enough to fix any problem. To minimize future headaches I want all files I use with emacs to be utf-8. Is there any way to (1) force emacs to display files as if they were utf-8 encoded and/or (2) always save new/and or edited text files with a utf-8 encoding?