Latin1, utf8 with Texmaker

I state that I have read many discussions about my problem but have not yet managed to solve. I 'the first time I use LaTeX and as editor I chose Texmaker. I'm writing on Windows 7 64bit.

I created a main.tex file as the following:

documentclass[a4paper, 11pt]{book}

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%\usepackage[latin1]{inputenc}
\usepackage[nouppercase, swapnames]{frontespizio}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{array}

\usepackage{graphicx}

\begin{document}

\frontmatter
\input{./frontespizio/frontespizio}
\tableofcontents

\mainmatter
\input{./capitoli/1}
\input{./capitoli/2}

\backmatter

\end{document}


Files 1.tex and 2.tex contain mostly text but also tables and images. In the text are obviously present accented letters as à, è, ò, ù... The problem is that when I compile the main file, there is this error:

pdfTeX warning: pdflatex (file pdftex.map): cannot open font map file
] [4] (capitoli/1.tex
Capitolo 1.
) (capitoli/2.tex [1] [2]
Capitolo 2.
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\ot1lmr.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\omllmm.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\omslmsy.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\omxlmex.fd")

LaTeX Warning: Command \textellipsis invalid in math mode on input line 12.

LaTeX Warning: Command \textellipsis invalid in math mode on input line 12.

Overfull \hbox (1.04575pt too wide) detected at line 22
\OML/lmm/m/it/10.95 LCS\OT1/lmr/m/n/10.95 (\OML/lmm/m/it/10.95 A[]; B[]\OT1/lmr
/m/n/10.95 ) = []

Underfull \vbox (badness 1132) has occurred while \output is active [3]
Overfull \hbox (92.19824pt too wide) in paragraph at lines 38--52
[][]

! Package inputenc Error: Unicode char ╬ƒ (U+39F)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
...

l.53 ...o ha complessit├á spaziale e temporale $╬ƒ (nÔêÖm)$ risulta poco adat...

?


Problem on the accented letters. Why? How can I fix? I looked in the settings of texmaker and how encoding is set to UTF-8. I tried to copy the text of the two and 2.tex 1.tex file in Notepad and save it as tex and utf-8 but nothing..

I do not know what to do.. Thanks!

The error message you copy&pasted is taken from a Windows terminal, which makes things a little more complex to analyze.

The important line in your error log is:

l.53 ...o ha complessit├á spaziale e temporale $╬ƒ (nÔêÖm)$ risulta poco adat...


This line points to the character causing trouble, which is the one at the end of the first line, i.e. ╬ƒ (and not the accented letters which appeared before, and caused no trouble).

However, surely you are pretty sure that your document does not contain the offending chars ╬ƒ, right? And you are right.

The problem is that Windows console uses the ancient MS-DOS code page, and not UTF-8, so your error message gets mangled. Using some iconv juggling in my (utf-8) linux machine:

$cat mangled_error.txt l.53 ...o ha complessit├á spaziale e temporale$╬ƒ
(nÔêÖm)$risulta poco adat...$ iconv -f utf8 -t cp850 < mangled_error.txt > error.txt
$cat error.txt l.53 ...o ha complessità spaziale e temporale$Ο

Aha! Now the error looks more readable. The offending char was not the à, as you thought, but the Ο, which is a (utf-8 encoded) capital letter Omicron. This character was not set up to be used in latex. Can you replace it by a "normal" (latin) O? See also: omicron not working in LaTeX
• You are right! Now he says that there is an error regarding the character &. ! Misplaced alignment tab character &. <argument> \numberline {2.1.1}Versione di Hunt & McIlroy l.5 ...rline {2.1.1}Versione di Hunt & McIlroy}{4}But I modified the text by removing the '&' like "Hunt and McIlroy" therefore should no longer report the error, and instead... – lonely Oct 24 '15 at 19:22
• & is a reserved char (to separate columns in a tabular environment). If you need to use it in main text, write \& instead. – JLDiaz Oct 24 '15 at 19:28