[Tex/LaTex] File Encoding and Input Encoding

input-encodings

In order to avoid cluttering other related questions, I separately make this question.

If I use Notepad as my editor, there are 4 encoding options available when saving the TeX input file: ANSI, Unicode, Unicode big endian, and UTF-8.

I want to know which input encoding do I have to use for each file encoding mentioned above.

For example, when I choose Unicode as the file encoding, which input encoding do I have to choose?

Best Answer

I assume you are using pdflatex: both xelatex and lualatex understand Unicode.

If you have non-ascii characters, your best bet is UTF-8 file with \usepackage[utf8]{inputenc}. Otherwise choose ANSI and do not use inputenc.

However there is a catch: Windows Notepad always saves the BOM (byte-order mark), which LaTeX does not want to see in the input. So if you would like to use a Unicode input encoding, I would not use Windows Notepad (until it lets you specify "UTF-8 without BOM" as a save option).