Consider the following plain TeX manuscript
\catcode`z=10 \newcount\charcode \charcode=`z \font\myfont=cmtt14\myfont character code = \the\charcode, category code = \the\catcode\charcode \end
The manuscript starts by setting the category code of the letter
z (ASCII 122) to
10. It then stores the letter
z's character code in the counter
\charcode. It then changes the font to Computer Modern Typewriter. Finally, it typesets the number stored in
\charcode as well as the corresponding category code.
When this manuscript is compiled with pdftex, the resulting typeset text is
character code = 32, category code = 10
So it appears that changing the category code of the letter
z also changed its character code from 122 to 32.
Is this behavior specified in the TeXbook or in the TeX engine's source code, or is it a bug in pdftex?