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


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:






Facultad de Ingenier\'ia\\
Departamento de Ingenier\'ia   el\'ectrica \\
Procesamiento digital de se'nales \\
\textbf{Tarea 3} \\
Miguel Dur\'an D\'iaz  \\
Profesor: Jorge Pezoa\\





\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 ?

  • 1
    Are you sure your document is encoded in UTF-8 rather than another encoding? (Try to prepare a minimal file and upload it somewhere--not copy and paste--if you'd like someone else to check this.) Nov 3, 2017 at 13:16
  • 2
    It is quite meaningless to say both \inputencoding{latin2} and \usepackage[utf8x]{inputenc}. What is the actual encoding of your input file, Latin2 or UTF-8? You should specify the correct one. Nov 3, 2017 at 13:19
  • Actually I'm not sure what you mean. When I was working this document (and it was ok) I was using utf-8 on Kile (using Ubuntu). Should I create a small document for this actual work? Nov 3, 2017 at 13:19
  • @ShreevatsaR I want to use the one that makes the document to work. As far as I know I should use UTF-8 but when I use that, the document doesn't work. Nov 3, 2017 at 13:21
  • By the way, Latin-2 was meant for Eastern Europe languages, so it's quite surprising to find it in a Spanish document.
    – egreg
    Nov 3, 2017 at 13:35

2 Answers 2


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)


The printed letters ǍĄ are a clear indication of utf8 input encoding.

Try to remove


from your source (by commenting it out using a % sign in front of it). You have already


so it should work than.

BTW, the more standard option to inputenc is just utf8, so try also

  • Using \usepackage[utf8x]{inputenc} (Removing \usepackage[T1]{fontenc} and \inputencoding{latin2} ) Makes TeX to say that there is 705 errors. Using: \usepackage[utf8]{inputenc} TeX says there is 274 errors. Nov 3, 2017 at 13:26
  • Keep the package fontenc, I did not tell you to remove that one. Nov 3, 2017 at 13:28
  • It is just the same: "Package inputenc error: Unicode Char ólol (U+14A). (It happens when I wrote "sólo". Actually by looking the errors, it seems that it happens with the spanish accent: I removed one spanish accent and I got 257 errors (instead of 258) Nov 3, 2017 at 13:32
  • Unfortunately, I cannot reproduce your problem with a test file. There is one possibility left: There are latin2 characters left over in the auxilliary files LaTeX has written in its previous runs. Recompile several times to get rid of them. When this does not help, delete all files ending in .aux, .toc, .lot, and .lof and compile again. Nov 3, 2017 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .