I mainly use Linux (arch) but for work, I have to use Windows 10. So I share some files between Emacs (28.2 installed via chocolatey) on Windows and Emacs (28.2) on Linux.
I never had any encoding issues on Linux, but when I use Emacs on Windows, it's messing up with some files (specially org files that have accents (é, è, ï, etc.)).
In order to avoid these problems I tried to force Emacs on Windows to only use Unicode and EOL: LF, by modifying init.
I tried many different tweaks found on:
- set-default-coding-system-utf-8
- emacs-change-default-line-ending
- how-to-configure-gnu-emacs-to-write-unix-or-dos-formatted-files-by-default
- emacs_file_encoding
But nothing works... The best result I managed to obtain is either:
saving files in utf-8 but with EOL: CRLF
U -- utf-8-dos (alias: mule-utf-8-dos cp65001-dos)
UTF-8 (no signature (BOM))
Type: utf-8 (UTF-8: Emacs internal multibyte form)
EOL type: CRLF
This coding system encodes the following charsets: unicodeor saving files in ascii with EOL: LF
-- undecided-unix (alias: unix)
No conversion on encoding, automatic conversion on decoding.
Type: undecided (do automatic conversion)
EOL type: LF
This coding system encodes the following charsets: ascii
When I'm trying to save new files (like .org files) from Emacs on Windows in utf-8 EOL: LF.