2

When compiling my code in Texmaker I get this error:

Error Package inputenc Error: Invalid UTF-8 byte "FC.

I don't know why. Can somebody help me?

\documentclass[11pt,a4paper,oneside,titlepage]{scrbook}
\usepackage[english,ngerman]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{siunitx}
\usepackage{esvect} % Für Vektoren
\sisetup{exponent-product = \cdot, output-product = \cdot, per-mode = fraction}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{tikz}
\newcommand*{\quelle}{%
  \footnotesize Quelle:
}
\usepackage{microtype}% verbesserter Randausgleich
\usepackage{endnotes}
\usepackage[ super , square , sort&compress ] {natbib}
\bibliographystyle{unsrtdin}
\usepackage{hyperref}

\begin{document}

\begin{filecontents}{MeineBib.bib}

% Encoding: UTF-8

@Article{Wikipedia2021, author = {Wikipedia}, journal = {https://de.wikipedia.org/wiki/Gleichwer ... note-D10-1}, title = {Gleichrichtwert}, year = {2021}, }

@Comment{jabref-meta: databaseType:bibtex;}

Der Gleichrichtwert wird wie folgt definiert: \cite{Wikipedia2021} \end{filecontents}

\addsec{1) Zitieren}%

Dieser in der Elektrotechnik verwendete Begriff steht für den Mittelwert des Betrages dieser Größe \cite{Wikipedia2021}

\bibliography{MeineBib}

\end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • Welcome to TeX.SE. – Mico Apr 11 '21 at 06:48
  • Have you seen this thread? https://tex.stackexchange.com/questions/429190/package-inputenc-error-invalid-utf-8-byte-147 – Ingmar Apr 11 '21 at 06:56
  • 1
    Did you really run this exact example in a new, empty folder? It compiles without the error for me. (Note that filecontents as used will not overwrite existing files, so if your MeineBib contains different content than shown here that could explain it.) You may also want to delete the .aux and .bbl files and recompile. In any case errors like this are usually caused by wrong/not matching file encodings. With a modern LaTeX (April 2018 or newer) you should look into encoding all your files as UTF-8. (Your .bib file claims to be UTF-8, so that would be good.) – moewe Apr 11 '21 at 06:58
  • 1
    There was a very similar question on goLaTeX recently with a screenshot of an error message (https://golatex.de/viewtopic.php?p=115251#p115251) complaining about "FC and "F6: That are the positions of ü and ö in Latin-1 (ISO 8859-1). That would strongly suggest one of the files is not actually saved as UTF-8, but as Latin-1. You have to find out which file that is and you have to make sure your editor (or whichever program writes it), uses UTF-8 from now on. – moewe Apr 11 '21 at 07:04
  • 1
    Your write-up is not easy to follow. For instance, you mention that loading the inputenc package throws an error; however, your same colde does not load the inputenc package, making it pretty much impossible to follow what may be going on. Also, what is the sentence "Der Gleichrichtwert wird wie folgt definiert: \cite{Wikipedia2021}" doing inside the bib file? Please clarify. For instance, do please inform us whether your real document loads the inputenc package and, if so, with which option, or options, it gets loaded. – Mico Apr 11 '21 at 07:27
  • @Mico Though to be fair modern LaTeX basically pre-loads inputenc, so you can get inputenc errors without an explicit \usepackage[utf8]{inputenc}. That seems to be what is happening here: No inputenc is loaded, so modern LaTeX assumes UTF-8, but the document is probably in something like Latin-1. – moewe Apr 11 '21 at 07:31
  • @JasminNiederbacher On close inspection I'm pretty confident that there is nothing wrong with your .bib file. The problem is that your .tex file is not encoded as UTF-8, but instead as something else (quite probably Latin-1 [ISO 8859-1]). You have two options: (1) Convert your .tex file to UTF-8 or (2) tell LaTeX to assume Latin-1 encoding (and then recode the .bib file). Since UTF-8 is the de facto standard file encoding nowadays I strongly recommend option (1). ... – moewe Apr 11 '21 at 07:34
  • ... Make a backup of your current files! Then set UTF-8 as standard encoding in TeXmaker (and all your other editors, https://stuff.mit.edu/afs/athena/software/texmaker_v5.0.2/share/texmaker/usermanual_en.html#SECTION01) It may be possible that TeXmaker does not change the encoding of existing files automatically to avoid messing up your document. Try to convince TeXmaker to recode it to UTF-8. If that does not work, you can try Notepad++, which is very good at those sorts of things – moewe Apr 11 '21 at 07:36
  • If you really must work with files in older encodings, the selinput package was created for this. It detects the file encoding automatically, so it will still work properly even if re-encoded. I also recommend using UTF-8. (In NFC form, as required by PDFTeX.) – Davislor Apr 11 '21 at 13:26

0 Answers0