1

I use TexShop on my computer and everything works well. But TexLive 2023 gives a fatal error: Invalid UTF-8 byte "AO

What do I have to do?

Mico
  • 506,678
  • 4
    Welcome! The first thing you need to do is to share a complete minimal example that shows your problem. – mickep Sep 19 '23 at 14:48
  • 4
    BTW, TeXShop is an editor for your tex file. "Everything works well" doesn't mean much in that context. – Teepeemm Sep 19 '23 at 15:24

1 Answers1

3

Your file might be saved in an encoding other than UTF-8. (This might be called Code Page 1252, Windows-1252, Latin-1, Western European, ISO-8849-1, ANSI, or many other things.) In many 8-bit encodings from the ’90s, "A0 is a non-breaking space. The fact that this seems to depend on which editor you save the file with probably means it’s misconfigured to save in the wrong encoding. All new documents should use UTF-8, which has been the default encoding for LaTeX since 2018.

The best solution is to configure your editor to save as UTF-8. If you really, truly need to load your source in some program from the last century that doesn’t understand UTF-8, add the following (and comment out any line that loads inputenc):

\usepackage{selinput}
\SelectInputMappings{
    adieresis={ä},
    germandbls={ß},
    Euro={€},
}

That should work with PDFLaTeX, regardless of which encoding you saved in.

Davislor
  • 44,045