[Tex/LaTex] Problem with inputenc

input-encodings

I created a TeX on Ubuntu using Kile. However now I'm working on Windows 10 using TeXnicCenter. Once I tried to compile the same TeX file I got about 80 errors. All the errors were concerned with encoding i.e "Package inputenc error: Unicode char A\expandafter (U+4F1). So I tried to find a solution and I found that using

\inputencoding{latin2}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}

the document compiles (removing any of the above commands, the compiler says there is an error). However, it looks ugly.

enter image description here

Notice the problem with the spanish accent and the weirds "d" and "u" that makes the document to look non-formal.

I will include just a part of the document since it is quite long:

\documentclass[a4paper,12pt,spanish]{article}
\usepackage[utf8x]{inputenc}
\usepackage[spanish,activeacute]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\inputencoding{latin2}
\usepackage{float}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{color}
\usepackage{geometry}

\decimalpoint



\begin{document}




\begin{titlepage}

\begin{center}
\vspace*{-1in}
\begin{figure}[htb]
\begin{center}
\includegraphics[width=1cm]{logo}
\end{center}
\end{figure}

Facultad de Ingenier\'ia\\
\vspace*{0.15in}
Departamento de Ingenier\'ia   el\'ectrica \\
\vspace*{0.6in}
\begin{large}
Procesamiento digital de se'nales \\
\end{large}
\vspace*{0.2in}
\begin{Large}
\textbf{Tarea 3} \\
\end{Large}
\vspace*{0.3in}
\begin{large}
Miguel Dur\'an D\'iaz  \\
\end{large}
\vspace*{0.3in}
\rule{80mm}{0.1mm}\\
\vspace*{0.1in}
\begin{large}
Profesor: Jorge Pezoa\\

\end{large}
\end{center}

\end{titlepage}

\tableofcontents

\newpage

\section{Problema 1}

A esta tarea se adjunta el archivo Matlab NoisyPixel.mat. Este archivo contiene los
datos medido en un pixel de una cámara infrarroja que toma 30 datos por segundo de un cuerpo uniforme que
está a una temperatura de 26 $^{\circ}$ C. Las mediciones tomadas son ruidosas y siguen el siguiente el modelo:
$$
y[n] = 26 + N[n]
$$

UPDATE: Opening the TeX File with Notepad++ I note that the document is ANSI-encoded however I want it to be utf-8. How can I solve that ?

Best Answer

SOLVED: For some reason, the TeX file was encoded using ANSI (probably because of differents OS). So, opening the TeX file with NotePad++ and converting it to UTF-8 makes the document to work. However I must rewrite all the spanish accents.

UPDATED: There was just a conflict between what I wanted and what the TeX was encoding. So, I just changed the option of the TeX editor to make it to encode in UTF8 (it was encoding in ANSI)