A TeX input file is, basically, a plain text file: that is, an unstructured sequence of bytes. For any program or application using this kind of files, they are just sequences of numbers from 0 to 255.
The fact that you, TeX, and your text editor see them as symbols and letters is because there is a convention that associates every number to a letter - the encoding. This is well until you realize that there are scores of encodings, and if the set of applications you are using do not agree about it, things happen.
Unfortunately, there is no standard way to say which encoding a file is using - you have to know it. And the package inputenc
is the way to tell LaTeX which encoding you are using.
Unicode utf8
is a de-facto standard nowadays, so the beat option is to convince your editor to use it, and add
\usepackage[utf8]{inputenc}
to your input file. And if you use a modern engine like xelatex
or luatex
the encoding must be utf8 and you do not even have a choice (so you shouldn't use inputenc
there).
A must-read about encoding is this blog post by Joel Sposky: http://www.joelonsoftware.com/articles/Unicode.html
\usepackage[<encoding>[inputenc}
should work fine here, provided you choose the right encoding. For most modern files it isutf8
but perhaps you've saved in some other form ... – Joseph Wright♦ Jun 15 '16 at 9:38usepackage[utf8]{inputenc}
and change the editor to useutf8
--- will save you a lot of problems in the future. – Rmano Jun 15 '16 at 9:55