[Tex/LaTex] Encoding problem with latexdiff


After discovering latexdiff, I wanted to give it a try and promptly ran into what seems to be an enconding issue.
Consider these two very simple example files (without special characters):


Hello StackExchange.
This is \LaTeX.

And the second:


Hallo StackExchange.
Hier ist \LaTeX.

Then I run the following command (utf8 should be the default encoding anyway):

latexdiff -e utf8 helloSE1.tex helloSE2.tex > helloSEdiff.tex

The output file is produced correctly, though I get a lot of warnings like:

Unescaped left brace in regex is deprecated, passed through in regex;

First, when I try opening helloSEdiff.tex with Texmaker, it's telling me that this file cannot be read with the default encoding, and I need to choose UTF-16.
Thus, I can open it, but when I run pdflatex on it, it just gives:

! Undefined control sequence.
l.1 \^^@

I am using TeX Live 2016, if this matters.

Best Answer

I had the same encoding-issue on my windows machine. I circumvented the issue by opening the tex-file with notepad++, going to the Encoding tab > Encode in UTF-8-BOM and then saving the file. I was then able to open and compile the tex-file in TexMaker.

Related Question