5

I have written some LaTeX commands in a separate file, say foo.tex and include them in my LaTeX document.

Only after I edit foo.tex with Notepad (default editor in Windows), I get the following error message when compiling :

Unicode char \u8: not set up for use with LaTeX

I suspect that Notepad alters my text file, which is saved as previously with the UTF-8 encoding. How can I prevent it ?

Speravir
  • 19,491

1 Answers1

9

Very likely notepad puts a byte order marker (BOM) at the start of the file. The "character" is invisible, but present. See also: How to make notepad to save text in utf-8 without bom?

For TeX files that are input after package inputenc is loaded, BOM can be disabled by:

\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{FEFF}{}
Heiko Oberdiek
  • 271,626