Compare a character to a character code?

There isn't a notion of a character code in a font. I think what you're looking for is

\ifnum`U=85 ...\else ...\fi

Note that since U has ASCII value 85, U and \char85 are both going to give you character in position 85 of the current font.


do you mean something like this?

\documentclass{article}
\begin{document}
\chardef\tempA=`U

\font\X=cmr10
\X
U looks like \char85, ...%
\chardef\tempB=085
\ifx\tempA\tempB and U is \char85 \else but U is not \char85 \fi

\end{document}