# Special characters are losing format every time I open a document

Ok I was working with this document at home and at work in Gummi. I was using a template where everything is set for spanish so everything was working fine. Today I come to work and I find that when I open my document on Gummi all the characters that were á, é, ó, í, ú and ñ are getting switched by weird stuff like MetodologÃÂ­a and I'm getting an error.

[24]) [25] (./capitulo_03.tex [26]
Cap\'{\i }tulo 3.

./capitulo_03.tex:1: Package inputenc Error: Unicode char \u8:­ not set up for
use with LaTeX.


Here is line 1 of the file where the error is supposedly found

\chapter{MetodologÃ­Â­a}


If I change the word MetodologÃ­Â­a to Metodología the problem gets fixed on that line but then it shows the next similar error.

Worst thing is that I changed all the words using find/replace but when I closed and opened again all the format was gone again.

% El documento está pensado para ser impreso en hojas por ambos lados (twoside)
% openright causa que los capítulos empiecen en hoja impar
\documentclass[12pt,letterpaper,twoside,openright]{report}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}      %Uso de tildes si desarrolla en Linux
%\usepackage[latin1]{inputenc}   %Uso de tildes si desarrolla en Windows
\usepackage{setspace} %define comandos \singlespacing, \onehalfspacing, \doublespacing
\usepackage[left=3.5cm, right=2.5cm, top=3.5cm, bottom=3.5cm]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{array}
\usepackage{algorithm}
\usepackage{algpseudocode}
\algnewcommand{\LineComment}[1]{\State $$\triangleright$$ #1}
\floatname{algorithm}{Algoritmo}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\usepackage{epsfig}
\usepackage{titlesec}
\usepackage{url}
\usepackage[pdftex,
pdfborder={0 0 0},
pdftoolbar=true,
citecolor=blue,
filecolor=blue,
urlcolor=blue]{hyperref}
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries\centering}{\chaptertitlename\
\thechapter}{20pt}{\Huge}

\begin{document}
\pagenumbering{roman}
\include{paginasIniciales}
\pagenumbering{arabic}
\include{capitulo_01}   % 1. IntroducciÃÂ³n
\include{capitulo_02}   % 2. Marco TeÃÂ³rico
\include{capitulo_03}   % 3. MetodologÃÂ­a
\include{capitulo_04}   % 4. Desarrollo
\include{capitulo_05}   % 5. Conclusiones
\part*{A P Ã N D I C E S}
\appendix

% ------------ Comienza la bibliografÃÂ­a ---------------
\newpage
\footnotesize
\singlespacing
\bibliographystyle{apalike}
\bibliography{mybib}
\end{document}




• Check what's the input encoding set by your editor, which probably isn't UTF-8. – egreg Jul 12 '13 at 17:20
• Wouldn't \usepackage[utf8]{inputenc} do? how come it works at home and worked before but not now? I'm not sure how to check it for the editor since I don't see an option. – Atirag Jul 12 '13 at 17:28
• If your editor is set, say, to Latin-1, the utf8 option to inputenc will not do any good. – egreg Jul 12 '13 at 17:29
• I tried fixing every character by hand and now it gives me this error /path/to/Document/.miTesis.tex.swp:41: File ended while scanni ng use of \language@active@arg>. Any idea if that has to do with it because if I understand correctly Gummi has no default encondig set. It kind of detects it. – Atirag Jul 12 '13 at 17:48

IMO, you are facing an editor problem : it seems that your file encoding is not properly recognized by Gummi. As you are using \usepackage[utf8]{inputenc} the source file must be saved in UTF-8, and likely it is the case. But when you reopen it is interpreted as ISO-8859-1 (aka latin1) or something like this : this is why the 2 bytes UTF-8 char is rendered by two single bytes chars.

Coogling on Gummi UTF-8 gives this link as the second answer.

You must find a way to force Gummi to open the file as UTF-8 *, or use latin-? or change your editor.

*In TeXworks, it's simply done by adding the string :

% !TEX encoding = UTF-8


at the beginning of the file.

• hmmm that problem on the link is specific for Windows but I'm running on Linux. I'll try to see how I can make Gummi open the file as UTF-8. Thanks – Atirag Jul 12 '13 at 17:52
• I ended up changing editors and it worked. No idea what caused Gummi to suddenly do that. Thanks. – Atirag Jul 12 '13 at 18:20

I finally figured out what happened. It appears that after an upgrade of Debian the locales for the language of the system broke. Gummi uses the OS locale which was not UTF-8. I had to restore the locales by running dpkg-reconfigure locales as root and that fixed the problem.