I want to show some nicely formatted source code, e.g.:
er ist ein bisschen ein ötto geworden
My document:
\documentclass[a4paper,10pt,ngerman]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage{listings}
\begin{document}
Ünnormal diggi hä
\lstinputlisting[language = python]{testinclude.txt}
\end{document}
The text outside the listing works, but the txt file produces the error Package utf8x Error: Character182appearedalone.
How do I show code that contains special characters?
Like this thread suggested, I tried escaping the ö or setting a literate to \''o, but both times I only got this in utf8 and utf8x: 
Package inputenc Error: Invalid UTF-8 byte "B6. I edited the question to show the input file. – Jan Berndt Nov 21 '19 at 21:05öis not\''obut\"o. – Jasper Habicht Nov 22 '19 at 09:30