# Package inputenc Error: Keyboard character used is undefined - ^^c0

I have a very large LaTeX document which can't be compiled because of following error:

/usr/share/texlive/texmf-dist/tex/latex/pdfx/pdfx.sty:1398:
Package inputenc Er
ror: Keyboard character used is undefined
(inputenc)                in inputencoding utf8'.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
...

l.1398 \ifcat ^^c0
\active \pdf@activecharstrue\fi


The problem is, I'm not able to find the problematic symbol, because of the document's size.

I wanted to "replace" the character with something different like this

\DeclareUnicodeCharacter{^^c0}{?????}


But it doesn't work. Am I doing something wrong or this character simply can't be replaced? Or do you have any other tip how to find the mistake?

I'm using pdflatex.

I've read several other questions, but I've not been able to solve this anyway:

### EDIT

It's this document - I've deleted almost all the text in main.tex and it's still not working...

### EDIT 2

Ok, the problem is obviously caused by pdfx package. I've tried to move it before inputenc include like this

\RequirePackage[a-1b]{pdfx}
\RequirePackage[latin1, utf8]{inputenc},


but now it gives me another error:

/usr/share/texlive/texmf-dist/tex/latex/base/article.cls:235:
LaTeX Error: Comm
Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.235 }

• It's on line 1398. – cfr Nov 25 '16 at 23:02
• @cfr The problem is, document is structured like a lot of small .tex files, so I don't know, which line is it really. – Eenoku Nov 25 '16 at 23:03
• Then comment stuff out until you find it, I guess. Sometimes, you can grep them, but not always. – cfr Nov 25 '16 at 23:20
• I guess pdfx should be loaded before inputenc, but the class does the converse. – egreg Nov 25 '16 at 23:20
• @egreg pdfx is the problem, but it didn't solve it completely. I've added info to my question. – Eenoku Nov 25 '16 at 23:27

The class file diploma.cls is not well written.

Packages should generally be loaded after \LoadClass. You can just move the \LoadClass declaration at the top. Also pdfx should be loaded before inputenc.

\def\fileversion{9.0}
\def\filedate{2016/06/20}
\def\docdate{20. června 2016}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{diploma}[\filedate\space \fileversion\space diploma EXPERIMENTAL LaTeX document class]
\RequirePackage[a-1b]{pdfx}
\RequirePackage[latin1,utf8]{inputenc}


I don't think the latin1 option to inputenc does anything good. Actually, the package should be loaded in the document and not by the class.

Sometimes is just an copy-paste issue.

Try manually re-writting the problem line.

It happened to me once that I helped a student who had some syntax error on a python line, the line visibly was something like:

variable = [1,2,3].append("text")


then I decided to delete that line, character by character, and it turned out that between the = and the [` characters I had to press 5 times the backspace.

This usually happens when you copy something from a rendered text document, like a PDF file, to your console.